java

Which Seam Context To Use For A Overview Page With Filters (State)

Hi all, I have a overview page containing a list with some links from which multiple workflows can be started (seam conversations). The overview page also has some filters that can be used to search the list. Therefore I would like to keep state (for the filters) on the serverside. At the moment this overview page uses a context of ...

Hooking into Display Tag pagination events

Does the Display tag JSP tag provide a way to hook into pagination events, so that you can execute your own code when the user pages the data? I couldn't work out how to do it from the docs. Thanks in advance. ...

New lines in Jasper Reports?

I've just started using Jasper Reports to generate reports from data retrieved using Hibernate. Everything is working, except JR doesn't seem to respect newline characters (\n) in text fields. Is there a way to force line breaks at newline characters? ...

Eclipse plugin editor

Hi, I want to create an editor in eclipse (as eclipse plug-in), for a java class that implement some interfaces i created. The editor will let the user edit some information (using a form) that will be put into the java class. - very much like in EJB editor. I want java files that implement this interface to open the editor. How can I ...

Should we assert every object creation in java?

Sounds like a stupid question with an obvious answer :) Still I've ventured to ask just be doubly sure. We are indeed using asserts like given below ArrayList alProperties = new ArrayList(); assert alProperties != null : "alProperties is null"; Problem is that making a small & simple document to follow, on asserts is difficult. Th...

Javax package and simple java application with spring hibernate

hello people! in my attempt to learn a bit faster the use of spring and hibernate i read few chapter on books and created a simple java project from netbeans 6.7. I've decided to use the hibernate annotations instead of mapping files.so in my pojo i import javax.persistence.*; and i have an error that javax doesn't exist.what sound surpr...

How to configure Artifactory using PostgreSQL instead of MySQL?

How would one configure PostgreSQL instead of MySQL to run artifactory? ...

No public execute() in class org.apache.jasper.JspC error when building

Hi I got the error 'No public execute() in class org.apache.jasper.JspC" while trying to build the ant xml file. I could see in the answer that there may be more than one jspC class in the jar file. I have jar files in tomcat, ant 1.7 and in my project. To where should I check for the class. i could see that there is jspC class in the co...

What is an efficient algorithm to find whether a singly linked list is circular/cyclic or not?

How can i find whether a singly linked list is circular/cyclic or not? I Tried searching but couldn't find a satisfactory solution. If possible, can you provide pseudocode or Java? For Example 1 3 5 71 45 7 5 -stop , its a circular linked list ...

Deadlock in java

can anyone post a java code that ends up in deadlock?? ...

I18n - Data is in one locale, ui in another, which locale do I use for sorting?

Hi, I am working on the I18n of our java application and we have decided that we will only support data in one locale whereas the user interface may support many. My question is this: Should sorting and filtering of data be performed using the user's locale or the data's? Orginally we had assumed it made sense to sort according to d...

java static void main

Hi to all I'm trying to print 'hello world' from a java program but I am a little confused with the main method: public static void main(String[] args) and public static void main(string args[]) Both these functions perform the same task. How does this happen? I know the function of String but not of the args. Thanks ...

Using XmlEncoder to create delta/difference xml

Hi! The idea is the following: The XmlEncoder records the operations needed to reproduce the serialized bean starting from nothing. But what if we do not start from nothing? Can XmlEncoder be used to record the operations needed to transform an object to an other? And can XmlDecoder be used to make this transformation? Or is there an...

modular development

What would you recommend for modular development in Java. OSGI is great but it's support for JPA is pitiful. I would really like not to have to write yet another framework, but it seems inevitable. ...

Replacement for Spring Richclient Statusbar class

I'm currently upgrading an application from the 0.2.0 version of Spring Richclient to 1.1.0, and the class org.springframework.richclient.progress.StatusBar seems to have been removed. I can't find any documentation on it, does anybody know if it's been renamed or if the specification has been changed? ...

Problem with Observer Pattern and generics in Java

I have made a generic Observer interface and an Observable class, but can't compile my class due to some generics problem. I don't know precisely why what I'm trying to do is forbidden. The code follows: public class Observable<U> { private List<Observer<Observable<U>, U>> _observers = new ArrayList<Observer<Observable...

Java HashMap get works but containsKey does not

Hi, I am trying to locate a key in a HashMap. I can print the selected key by using 'get' but when I use 'containsKey' in an if statement, it is not found. I KNOW the key is present in the Map but it keeps returning false. Any ideas people? My code: public static boolean checkLowerStructuralSupport(Location location) { boolean hasS...

Java LDAP with SASL

Hi, I am using Java 1.2 with the Netscape ldapjdk.jar and trying to make an LDAP connection to one of our servers that needs SASL. I’m also relativity new to LDAP. I do know that java EE has built in LDAP but I am not able to use it at this time. I have been able to make a connection to another server using regular LDAP but I am not ...

Hibernate bidirectional parent/child problem

I'm having a problem implementing a bi-directional parent/child relationship using hibernate 3. The parent, in this case is of the class ReportCriteria. The child is of class PkVisit. I've pasted my hibernate configuration files as well as the underlying java objects below. ReportCriteria configuration: <hibernate-mapping package="org....

Java: Multiple threads vs. sockets

I've written a simple application in Java where there are two nodes, each with a ServerSocket open to a port listening for incoming connections. The nodes run two threads each, sending 1000 messages to the other node through a persistent TCP socket created when sending the first message. However, the nodes do not receive all 1000 message...