java

Equivalent of a DataGridView (from .NET) in Java?

Hi, I'm searching for a quick way to implement something like a DataGridView (originally component from .NET) into my JSP. Basically I'd like to do a CRUD on an entity within the same page. Do you have any idea for that? Thanks ...

Sax parsing and encoding

I have a contact that is experiencing trouble with SAX when parsing RSS and Atom files. According to him, it's as if text coming from the Item elements is truncated at an apostrophe or sometimes an accented character. There seems to be a problem with encoding too. I've given SAX a try and I have some truncating taking place too but have...

Base Class "Does Not Seem to Have Been Enhanced" After Upgrade of Google App Engine SDK for Java

I get errors like this when attempting to run unit tests under App Engine SDK 1.2.8. The unit tests pass under SDK 1.2.6 using the same code. "Class com.foo.bar.BaseClass does not seem to have been enhanced. You may want to rerun the enhancer and check for errors in the output" A class which extends BaseClass IS persisted, but has the...

How to get parameters from the URL with JSP

In JSP how do I get parameters from the URL? For example I have a URL www.somesite.com/Transaction_List.jsp?accountID=5 I want to get the 5. Is there a request.getAttribute( "accountID" ) like there is for sessions or something similar? ...

Hibernate : Java Application must be restarted for data to be realoaded.

I am programming a JSP/JSF Web application and currently using Hibernate (and MySQL) libraries. When I update data using my running application everything is working fine. Example : I modify a customer information Although if I change data manually or add an entry in MySQL manually, the change will not be effective on my application si...

find MD5 hash of the bytes of the given String's UTF-8 encoding

Hi, I need to implement a method to find the MD5 hash of the bytes of the given String. It seems to me that this class is included in the package called com.starbase.util.MD5, but could not find where to download a jar file. Could someone point me to the right place? ...

Java servlet - export to an excell

How to make an excel file (and txt file) filled with data from a table on the html page in a servlet and send it to a browser? ...

How to represent the top 8 bytes of the MD5 hash of the bytes of the given String's UTF-8 encoding as a long in java?

How to represent the top 8 bytes of the MD5 hash of the bytes of the given String's UTF-8 encoding as a long in java? ...

Calling DisplayTag returns NullPointerException

We've been using DisplayTag for awhile now without any problems, but recently, we had a wonky hdd and so we had to restore some of the stuff on there. Unfortunately, DisplayTag broke and stops everything else when called: <display:table name="pageScope.userKeyList.licenseKeyList" id="userKey" pagesize="10" defaultsort="7" defaultorder="...

Problem with a data member(field) in Java and priting it out? how to properly implement?

I want to print out the result of calcWork() in printReport() but I keep getting 0.0 Is there a problem with setting work = this.totalWork;? public class CarnotEngine { public double n = 10; public double R = 4; public double Th = 8; public double Tc =2; public double Va = 4; public double Vb = 3; public double totalWork; ...

Android Set a new QUICK_LAUNCH in android.provider.Settings

I am trying to figure out how, if its even possible, to assign a new "quick launch" key programmaticly. To do it manually its Menu - Settings - Applications - Quick Launch But I would like to have a button where users can set it within my app. Thanks to anyone of helps at all. Spent hours searching. Some info: hXXp://developer.and...

Writing arrays of Parcelables to a Parcel in Android

I'm trying to write an array of objects that implement Parcelable into a Parcel using writeParcelableArray. The objects I'm trying to write are defined (as you'd expect) as: public class Arrival implements Parcelable { /* All the right stuff in here... this class compiles and acts fine. */ } And I'm trying to write them into a ...

non java-developer question

Just a basic question about Java (haven't really done anything with it personally yet): Is it possible to write a Java program that runs in a web browser (via JRE) on the client machine? Is something like Groovy or JavaFX really a wrapper for something that technically could be written in Java? I assumed that JavaFX at least was inten...

Using miglayout with netbeans.

I'm trying to use miglayout within the netbeans IDE. Ive placed the miglayout files in the right place and then imported using: import net.miginfocom.swing.MigLayout; at the top of my file but it states that "package net.miginfocom.swing does not exist" Any ideas on how I can get miglayout working withing netbeans? Any way possible? ...

Weblogic application complains about some classes missing, how to debug?

I have a rather complex J2EE app I don't have any documentation for and I am trying to get it to run. I have gotten the ant build script to compile a EAR file that contains a WAR file, but this application even though I get "successfully deployed" on weblogic console is still not working. There are many required jars missing from the...

Check type of primitive field

I'm trying to determine the type of a field on an object. I don't know the type of the object when it is passed to me but I need to find fields which are 'long's. It is easy enough for Longs but the primitive long seems more difficult. I can make sure that the objects passed to me only have Longs not the primitives but I'd rather not. S...

2D LinkedList.contains() in Java

Hey, everyone. I'm new to Java and I have 2D LinkedList like this: LinkedList<LinkedList<String>> albums = new LinkedList<LinkedList<String>>(); Which is filled with data like so: if (!artist.isEmpty() && !name.isEmpty()) { albums.add(new LinkedList<String>()); albums.getLast().add(artist.toString()); albums.getLast()...

Read text from InputStream

If I start with a java.io.InputStream, what's the easiest way to read the entire stream out into a String (assuming utf-8)? This should be pretty easy but I'm mostly a C# person and google is failing me on this. Thanks. ...

Android Spinner - How to remove radio buttons?

In Android 1.6, upon tapping a spinner (drop-down menu), radio buttons appear next to the spinner options. How do I remove those radio buttons so that just the option text remains? ...

clojure friendly java library for traversing NAT

I need to be able to establish a connection between two boxes that are both behind NAT? I have a central system that both sides can find each other through. I'm working in Clojure. ...