java

JAXB is good until I need to do something complex. What are the alternatives?

JAXB works well until I need to do something like serialize beans for which I cannot modify the source. If the bean doesn't have a default constructor or if it refers to objects I want to mark transient then I'm stuck writing a separate bean which I can annotate and then manually copy the information over from the other bean. For instan...

Editor for HMIs in Java

I found this question http://stackoverflow.com/questions/1159349 and mine is roughly the same, except, that I need a Java version. What I would need, is a editor which can be used standalone to create the GUI. It should support some kind of abstraction of datasources and data items which can be bound to the symbols placed on the view. I...

Java Data Structures Reference

Can anyone give me references of a web site containing a summary of the main Java data structures, and their respective complexity in time (for some given operations like add, find, remove), e.g. Hashtables are O(1) for finding, while LinkedLists are O(n). Some details like memory usage would be nice too This would be really helpful for...

Is <load-on-startup> optional for a servlet in the Java Web application deployment descriptor?

Is element <load-on-startup> optional for a <servlet> definition in the Java Web application deployment descriptor (WEB-INF/web.xml)? ...

Dynamic Class Loading in Java (Enumeration)

Hi, I have a problem, I wish to use reflection to generate instances of one of a set of classes at runtime. However, I have hit a snag. I want to get all of the classes involved to register themselves so the appropriate class can be chosen from a GUI. I can do this using a static code block in each file which provides a tidy OO solution...

Hibernate @OneToMany - mapping to multiple join tables

Consider the following domain model: Issue - id - List<Comment> Entry - id - List<Comment> Comment -id -comment In my design, I was attempting to create two join tables to manage the associations; issue_comments, and entry_comments. I assumed @OneToMany on Issue & Entry, but how do you map the multiple join tables? Using hibernate ...

Maven command line

Hi all, Is it possible to set environmental variables in a build profile as opposed to setting them in the command line? For instance, I want to enable the debugger when I'm using my test environment (-Denv=test). I want maven to do this: export MAVEN_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=...

When using proxool, do I need to explicitly close every getConnection()?

I'm writing new DB connection code, and thought I'd try proxool as the connection pool implementer. Normally, a programmer would ensure that every DriverManager.getConnection(...) is followed by a connection.close(). But when using Proxool, is the close needed? I'm confused because: a. The proxool documentation here (http://proxoo...

Java: Prevent subclass from providing a different interface than base class

Is there a means to prevent a subclass from exposing public methods other than those defined in the base class, at compile-time? For example: abstract public class AClass { abstract public void anAllowedMethod(); } public class BClass extends Aclass { public void anAllowedMethod() { } public void anAdditionalNonAll...

How can I work around Castor's default behaviour to create wrapper classes for complexType elements?

I'm using Castor XML code generator. If you have two schemas with complexTypes defined as follows: <xs:schema ...blah...> <xs:complexType name="FooBarType"> <xs:sequence> <xs:element name="meh"/> ...etc... </xs:sequence> </xs:complexType> <xs:element name="FooBar"/> </xs:schema> and <xs:schema ...blah ...> ...

Execute an external EXE from Flex/AIR or Java Web Application..

Hi, Need to execute an external EXE from either a Java web app (running on Glassfish on Windows Server) or from an Flex/AIR desktop app. Any suggestions, links? Thanks, ...

Configure Restlet to Return JSPs on Google App Engine?

I have a developed a Restlet application. I would like to return a JSP file on a URL request through Restlet. How can I achieve this without using a redirect? i.e. Let's say I have the file "contact.jsp" on mydomain.com and I want people to be able to access contact.jsp at http://mydomain.com/contact Thus, in Restlet, I would have: r...

dbUnit data types

I'm using dBUnit and am trying to assert a row of my pre-defined FlatXmlDataSet with the actual DB dataset. The problem is the getValue for my Verification Code field returns a string when that data originates from the FlatXmlDataSet and as an Integer when its from the actual live database. This is true with any data type that isn't a St...

write java wrapper

1.this is how my dao class look like where the transaction code keep repeat for every method. possible to put these snippet code in super class so that i do no need to repeat below code all the time? any elaborate how to do this? 2.if there is a need to put the snippet in super.class. should the super.class be static? for (int i = 0;...

a JPanel problem

Hello all, i am writing up a project just as part of my experiments... (for everyone that has already help with my other questions, thank you for very much.) Alright i have one file that already works.. both of my source files compiled correctly i have two jpanel's that are overridden so i can change their paintcomponents. One i use as ...

Extracting text from a PDF file

Hi, I need to extract the text from a PDF file. This text will likely be in a table format, and it is going to be used for automatic transfer of data between an external party and our systems. Can anyone suggest a command line tool (eg pdf to txt) or a library that would be good for this? Language options: C# (preferred) Java (if I ...

Java FileDialog programmatically set size

I want to display a Java FileDialog and sets its initial size to something reasonable (it doesn't show the maximize button, and a lot of users might not know you can use alt-space X instead). I tried setBounds but it didn't do anything, and I don't see a method for maximizing it; what am I missing? Update: on Windows at least, the syste...

Constructor in Servlet?

Can we write an argument constructor in a servlet? if yes, how can you call? ...

What do implementations like jGuard provide that JAAS doesn't ?

Hi, I have been looking at JAAS and implementations like jGuard, Acegi etc over the last two weeks , but still couldn't decide/understand which to go for in my application. Here's a brief description of my application:- A social game kind of app(with open collaborative forums/discussions/groups) with Flex on the Front end and J2EE on th...

Installer generator written in Java?

I'm looking for a free cross-platform installer generator that is fully Java-driven (meaning workflow and plugins are written in Java). Ideally the installer should download the JRE on-demand instead of bundling it directly into the installer. Does something like this already exist? Please note that InstallAnywhere no longer offers a fr...