java

Problem with richfaces ajax datatable + buttons

Hello i have another problem with RichFaces this is my application and it shows how i want it to work : http://www.screencast.com/users/Schyzotrop/folders/Jing/media/a299dc1e-7a10-440e-8c39-96b1ec6e85a4 this is video of some glitch that i can't solve http://screencast.com/t/MDFiMGMzY the problem is that when i am trying to press any butt...

Regular Expression Help.

I wrote a Regular Expression that generates a url like /abc/deutschland/bbs-tagesfahrten/betz-mode-frotier-center-–-tress-teigwaren.html. Now I want to replace the repeating dashes with the single on. How Can I? ...

Why does my icon handling code throw a NullPointerException?

I have added an image for my button,but when I run that frame this exception will be thrown .why?please help me. init: deps-jar: compile-single: run-single: Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at javax.swing.ImageIcon.<init>(ImageIcon.java:138) at ClientGUI.IdAndPasswordFrame.initCompon...

problem generating random no in java

i have written a code like this but it is giving exceptions.actually i want to generate a random value.save into the database and return the same to the user import java.math.BigInteger; import java.security.SecureRandom; public static String recoverpassword(String uid,String ans) { try { verifyans.setString(1,uid); ...

Hibernate, MySQL Views and hibernate.hbm2ddl.auto = validate

I can use MySQL views in Hibernate by treating them like tables - ie. the entity is no different than one created for a table. However my application won't deploy when Hibernate is set to validate the model as it can't find the View as it assumes it's a table. Is it possible to use Hibernate Entities with deploy time validation turned o...

Architecture guidebook for Java web application?

I'm looking for some good books/internet material that discusses on how to make decision on architecture for a Java web application, discuss on various considerations etc. I found this "J2EE Architecture Book" on TSS : http://www.theserverside.com/tt/books/DVTPress/J2EEArchitectsHandbook/index.tss The book is not only dated, but has p...

Pitfalls in getting memeber variable values in Java with reflection

I have an abstract class as follows. I want to get all the values of member variables. public abstract class PARAMS { public static final String NAME1 = "VAL1"; public static final String NAME2 = "VAL2"; public static final String NAME3 = "VAL3"; } The values are retrieved using reflection as follows. Field[] fields = P...

Efficiency of Hibernate's table-per-subclass inheritance strategy

I'm thinking about table layout for a Hibernate-managed class hierarchy, and certainly the table per subclass technique strikes me as the most appropriate in a general sense. However, thinking through the logic I have some concerns about its performance especially as the number of subclasses scale. To give a very brief (and classic) ex...

DB backup problem with Spring/Hibernate GenerationType.AUTO

Hi, I work with Spring/Hibernate Dao's for saving my Object in the Database. Now I had to backup all my DB inside my application. Now when I try to read my backup back, my application crashed. Now I found the problem for this crashing. It's Hibernate it creates automaticly a new ID for my Object when I want to save. For example I save...

Threaded State Machines in Java

Is there a way of Holding a thread in a State waiting for changes? I mean wait tll something happend (change var, call method, etc..) perhaps it needs using Event Listeners, or synchronized objects/methods.. The usual aproach for statemachines like this statemachine example That uses a do{..}while(true) loop that could work for singl...

How do I use a EJBQL between query with two identical dates?

I have a JPA named query that takes two dates in order to return records with a date column entry between the two dates. If I enter the same date for both the start and end dates it returns no rows, even though there are records for that date. Is there way to make the query work or shall I just run another query when the two dates are ...

where can i download java SDK?

im learning how to code in java and the tutorial says that i have to download SDK from their site. but im so confused cause i see java SE, ME and EE and i dont know what they're for. to code in php i need MAMP and a IDE (netbeans). what do i need to code in Java? Java server (eg jetty)? and what more? ...

How to generate events from graphics generated by Java2D

I have made an Ellipse with the help of java.awt.geom.Ellipse2D Now, I want that whenever user clicks on that ellipse, an event is generated so that I can listen to that event and peform subsequent tasks based on the ellipse which generated that event. ...

Problem with Informix JDBC, MONEY and decimal separator in string literals

I have problem with JDBC application that uses MONEY data type. When I insert into MONEY column: insert into _money_test (amt) values ('123.45') I got exception: Character to numeric conversion error The same SQL works from native Windows application using ODBC driver. I live in Poland and have Polish locale and in my country comma...

JEE Role Management systems - do they exist?

I'm looking at creating a decentralised role-management system which integrates with JEE roles. Does anything like this exist? Example use cases: System A is a limited-access system which uses corporate roles. John joins a team, and requires SYSTEM_A_READONLY to perform his function. He logs on to the decentralised role-management syst...

Java-DAO: How can I save a default value in a tabel?

I have these 2 tables: T1: County- Name - FK_Country T2: Country - Name And when I want to save a County, I want to choose a default Country, but I receive this error: object is an unsaved transient instance - save the transient instance before merging: local.Country; nested exception is org.hibernate.TransientObjectException: objec...

How can I create a frame which includes animation?

I have a frame and I want to show some white sphere in the different location in my frame,I have researched a lot but I found some codes for using applets but i don't want to use applets. please help me with some code or references. Thanks. ...

ConcurrentLinkedQueue Questions

Hello Experts, Could you please clarify if we need to use explicit synchronization or locks for using ConcurrentLinkedQueue? I am specifically interested in knowing if sync calls are needed for following ConcurrentLinkedQueue methods. add clear size Possibly size is the only method which might require explicit sync since it's a not ...

Strange behaviour with parameterized method on abstract class

Hi. Can someone tell my why this gives a compile error? I don't see why the cast to A in the second for-loop causes strings() to return a general List of Objects. import java.util.ArrayList; import java.util.List; public class E { public static void main(String[] args) { for (String s : new D().strings()) { Sys...

JEditorPane do not respect html table height 100%

Hi Stackoverflow, i have got a problem, my JEditorPane do not respect HTML-Table style="height: 100%;" do you have an idea? JEditorPane jEditorPane = new JEditorPane(); JScrollPane scrollPane = new JScrollPane( jEditorPane ); jEditorPane.setPage( url ); JFrame frame = new JFrame( ); frame.getContentPane( ).add( scrollPane, BorderLayou...