java

Load-Testing a Java-Client-Server-Application

Hi, we use spring-remoting for a Client-Server-Application. Now we are in doubt how to realize a real load test with serialized objects. The problem is that many load testing toolkits are based on plain text HTTP communication, so it's very easy to parameterize the http-requests. Because spring-remoting is based on serialized objects w...

Issue updating a dynamically-binded AutoPopulatingList in Spring/JSTL

Hello, I am having an issue updating a select box's value that was created from a dynamically-binded AutoPopulatingList. Here's what I have: An AutoPopulatingList "basicList" that contains "BasicDefinition" objects that I created. Each BasicDefinition object contains: String value OperatorType object (the OperatorType object contains...

Using JNDI for distributed configuration

We're looking at how to do distributed configuration within our primarily Java based deployment. We have a number of applications and it makes sense to centralise the configuration of the applications. JNDI appears to be the standard choice, probably backing off to something like ApacheDS (that way we can store non Java config in there a...

In htmlunit, how can I get the request, that would be sent on clicking an element?

Hello, I want to find a way to get the settings of the request that would be sent if I clicked a certain link. I want to send the request after making some modifications. Is that possible? Answering the comments, right now I want to change the headers sent, but post values or target url may be of interest too. I want to grab the request...

Android: Parsing XML DOM parser. Converting childnodes to string.

Hello, Again a question. This time I'm parsing XML messages I receive from a server. Someone thought to be smart and decided to place HTML pages in a XML message. Now I'm kind of facing problems because I want to extract that HTML page as a string from this XML message. Ok this is the XML message I'm parsing: <AmigoRequest> <From></Fr...

How to set a class of my creation to be a key in a TreeMap (Java)

I created a class DateTime (which wraps GregorianCalendar). I also created a class Event. I would like to create a collection of events from which I can retrieve an event by its date. For instance: event is of type Event; date1 and date2 are of type DateTime and also date1.equals(date2); 'events' is my event collection. event.put(date1,...

Is Java "caching" anonymous classes?

Consider the following code: for(int i = 0;i < 200;i++) { ArrayList<Integer> currentList = new ArrayList<Integer>() {{ add(i); }}; // do something with currentList } How will Java treat the class of currentList? Will it consider it a different class for each of the 200 objects? Will it be a performance hit even after the fir...

How to detect Java is installed on a Windows system from a batch file?

I am looking for a batch file snippet that somehow reads the Windows registry and detects which Java JRE's are on a Windows system and then asks the user which one they want to use and remembers the choice. Here is what I have so far... needs some modifications. This script only finds the first JDK... it doesn't handle multiples. ::Ge...

How can one develop iPhone apps in Java?

Hi there, In my computer science class, I have completed all my projects; So my teacher thought it'd be a good idea to develope IPhone apps. The only problems is that the class is taught in java, and IPhone apps are written in Objective-C. I was wondering if anyone has developed applications in Java, with XMLVM. This compliler (supposed...

Google App Engine application instance recycling and response times...

Hi, I posted this on GAE for Java group, but I hope to get some answers here quicker :) I decided to do some long-run performance tests on my application. I created some small client hitting app every 5-30 minutes and I run 3-5 of threads with such client. I noticed huge differenced in response times and started to investigate issue. ...

Should the service layer keep any state? or have it injected via a constructor/setter only?

I have a OrderService that I use in my controllers. What I did was just inherit from a custom controller where I added the OrderService as a property. I initialize the OrderService in the OnActionExecuting event. When initializing the OrderService, I set the Order property. This is because the OrderService performs actions on a Order...

Hibernate resolve foreign key lookup id by name

I'm in the process of writing a module for an application that bulk imports data. I'm using Hibernate version 3 for data access. I receive a flat table of data let's call it products for simplicity and assume this data layout: Name, category, sub-category foo, main1, sub11 The category and sub-category fields actually refer to the ...

Get most popular items in Grails

My simplified domain model in grails is like this: Article { Integer totalViews static hasMany = [ ratings: Rating ] } Rating { Integer value // 1 to 5 User user } I am trying to find the 5 most popular articles based on totalViews and ratings, say 25% weightage on views and 75% weightage on ratings. How ...

undo, redo, delete function in java

hi there, I need to write these 3 functions, but i got stuck at redo and delete. Redo is showing error when there is nothing to redo and i don't know how to write delete function. Thank you undo public class Undo extends AbstractAction { private MyCanvas myCanvas; public Undo(MyCanvas myCanvas) { this.myCanvas = myCanvas; thi...

How to sort through an association table in hibernate?

Given a representation of database tables where two entities are connected through a join table, is it possible to sort on the other entity specifying the sort order somehow through annotations? Consider, roughly, the following database tables: actor ( id, name ) credit ( actorId, movieId, roleName ) movie ( id, title, year ) And hi...

Is there the equivent of a Java Set in php?

Is there the equivalent of a Java Set in php? (meaning a collection that can't contain the same element twice) ...

Why doesn't this java program constructor go on infinitely?

Looking at some code, learing about threads: import java.applet.*; import java.awt.*; public class CounterThread extends Applet implements Runnable { Thread t; int Count; public void init() { Count=0; t=new Thread(this); t.start(); } public boolean mouseDown(Event e,int x, int y) { t.stop(); return true; } pu...

IllegalMonitorStateException

What can cause that i get IllegalMonitorStateException in this code synchronized(syncCount){ syncCount--; syncCount.notify(); } I'm little confused, since, as far as I know running thread must have monitor on object who's notify is called. It looks to me that my code can not be wrong, but somehow it is. ...

In java why not widen then box?

Hi In java we can box and then widen. Why cant we widen and box? For ex: class WidenAndBox{ static void go(Long x) { } public static void main(String [] args) { byte b=5; go(b); } } Compiler error ...

Can AWT file choosers not access Aliases in OSX?

I need to use AWT file choosers for my java app because we want to give users the native mac file chooser. Yes I know abut quaqua and we use it, but it does not use the native file chooser and mac users do not like it. The file chooser I am currently worried about sets the global propery: System.setProperty("apple.awt.fileDialogForDir...