java

GWT + Spring

Hi Can I access spring bean that exposed using http invoker (server) from GWT application (client) ? If so is there any example / tutorial for that ? -- Yonatan ...

Which is the best Open source application server?

We are looking for a open source J2EE Application server for log budget deployments. We are considering JBoss and Glassfish. Which is the best open source application server? Any comparative study available? ...

How to use Hibernate @Any-related annotations?

Could someone explain to me how Any-related annotations (@Any, @AnyMetaDef, @AnyMetaDefs and @ManyToAny) work in practice. I have a hard time finding any useful documentation (JavaDoc alone isn't very helpful) about these. I have thus far gathered that they somehow enable referencing to abstract and extended classes. If this is the case...

How to toggle between one maven profile and another?

If I have a maven profile activated by the presence of a property, how can I define another profile that is only activated when the other profile is not activated? e.g. <profile> <activation> <property> <name>myproperty</name> <value>value</value> </property> <...

Problem with Commons Logging / Log4j setup in spring webapp with tomcat 6

I have a problem wih a logging setup in a apring webapp deployed under tomcat 6. The webapp uses the commons-logging api, on runtime log4j should be used. The log file is created but remains empty - no log entries occur. the setup is the following: WEB-INF/web.xml: <context-param> <param-name>log4jConfigLocation</param-name> ...

Is there a performance difference between Javac debug on and off?

If I switch on the generating of debug info with Javac then the class files are 20-25% larger. Has this any performance effects on running the Java program? If yes on which conditions and how many. I expect a little impact on loading the classes because the files are larger but this should be minimal. ...

Logging PreparedStatements in Java

One thing that always been a pain is to log SQL (JDBC) errors when you have a PreparedStatement instead of the query itself. You always end up with messages like: 2008-10-20 09:19:48,114 ERROR LoggingQueueConsumer-52 [Logger.error:168] Error executing SQL: [INSERT INTO private_rooms_bans (room_id, name, user_id, msisdn, nickname) VAL...

Wicket + Javascript

I'm wrapping up a Javascript widget in a Wicket component. I want to let the JS side talk to the component. What I've got so far: Component in question goes like talker = new GridAjaxBehavior(); this.add(talker); in constructor and then, later on, puts something like "var MyGridTalker = new talker(" + this.talker.getCallbackUrl()...

How do I change JPanel inside a JFrame on the fly?

To put it simple, there's a simple java swing app that consists of JFrame with some components in it. One of the components is a JPanel that is meant to be replaced by another JPanel on user action. So, what's the correct way of doing such a thing? I've tried panel = new CustomJPanelWithComponentsOnIt(); parentFrameJPanelBelongsTo.pack...

How to ignore CVS keyword tags in eclipse diff

As much as i like the eclipse diff/merge perspective, when dealing with large projects and multiple branches that need to be merged occasionally there's one feature missing: Is there any way to set the eclipse diff to ignore the CVS tags like $Author:$, $Revision:$ and so on? Since these tags are different in all the branches, a "compa...

Sun Java System Portal Server 7.1

Hi , I guess I can extend the base providers to manipulate the base layout etc.Is there any place where I can get the java source code for default providers? Where are the classes for these default providers copied to ?What are list of things that I can manipulate by extending base containers? Is there a comprehensive documentation on me...

Which is the simplest and least dependent AOP framework in Java?

I want to use an AOP framework, but I have two constraints. Any framework that I choose Must be fairly independent. I plan to use this in a legacy code base, and hence cannot upgrade prospective dependencies like commons-logging-XXX.jar to commons-logging-newest.jar. Must be fairly well documented, should not be too complex to unders...

Does Java Connection.close rollback?

Does Java Connection.close rollback into a finally block?. I know .Net SqlConnection.close does it. With this I could make try/finally blocks without catch... Example: try { conn.setAutoCommit(false); ResultSet rs = executeQuery(conn, ...); .... executeNonQuery(conn, ...); .... conn.commit(); } finally { c...

What is a Null Pointer Exception?

What are null pointer exceptions and what causes them in general? ...

How do I broadcast in adhoc networks?

How do I broadcast a message from a single source to all nodes, and from multiple sources to all nodes? Are there any libraries in java that may help? ...

Managing database changes between a Rails and Java project

At a new job I started, we have both a Java application that handles most of the heavy lifting in the core business logic, and we also have a Rails application that of course handles the web interface to this server. Both of these access the same database. Up until now, most of the focus has been on the Java application, and as such, t...

Customized naming of columns in JPA relationships

When I make relationsships with JPA using hibernate, some terrible long and ackward column names are generated. Eg. I have the following actionPlan_actionPlanPK, which means that the column actionPlan is a FK that points to actionPlanPK. To make it look just a little bit more neat in the DB I would like if I could give it a name myself, ...

How do I programatically inspect a HTML document

I have a database full of small HTML documents and I need to programatically insert several into, say, a PDF document with iText or a Word document with Aspose.Words. I need to preserve any formatting within the HTML documents (within reason, honouring <b> tags is a must, CSS like <span style="blah"> is a nice-to-have). Both iText and ...

Placement of instance variable declarations

I've seen some developers put instance variable declarations at the end of classes though I mostly see them placed at the top. The only reasons I can think of for doing this are stylistic preference or maybe it somehow makes them easier to work with in an IDE. Is there a more legitimate reason for choosing this style? ...

A good library to do URL manipulation in Java

I need to do a few very simple URL manipulations in Java. Like get the value for a parameter in the query, or update it, ... I was expecting to find a simple utility class doing that in the commons-lang package, but no. I know it is a simple problem, but if there is something already written, why do it again ? Do you know of any ? I wou...