java

Fetching remote objects add "_$$_javassist_x" to type

Hi, we have a client/server app (Flex and Java) that uses BlazeDS to do remoting. This allows us to exchange and map types between client and server. For some reason a User type we are retrieving from the server is not sent as "User", but as "User_$$_javassist_x", where x is an integer. The other types we are sending over all work fine...

Arithmetic operator confusion

Why I'm getting two different values while using the arithmetic operators for the same value of variables. I've just altered little bit my second program, which is resulted in giving me the different output. Could anyone please tell me why? int number=113; int rot=0; rot=number%10; rot*=100+number/10; System.out.println(rot);//3...

UTF-8 Encoding in java, retrieving data from website

I'm trying to get data from website which is encoded in UTF-8 and insert them into the database (MYSQL). Database is also encoded in UTF-8. This is the method I use to download data from specific site. public String download(String url) throws java.io.IOException { java.io.InputStream s = null; java.io.InputStreamRe...

from html to servlet

hi i'm learning html and sevlets,i wrote small aplication but i'm not getting any output when i click submit button from from.html page: below is my code <html> <body> <h1 align="center>Color Selection Page</h1> <form method="POST" action="/SelectColor.do" > Select Color Charecterstics<p> Color: <select name="color" size="1"> <option>li...

Splitting a large Ear to seperate wars with SSO a good idea?

I am working in an environment where there is one very large EAR that runs the whole website. This is large to the point if being unwieldy e.g. slow deployments, long checkouts etc. I'm considering splitting the ear in to seperate war's that are deployed seperately and then using a single sign on solution such as CAS to implement authen...

Button inside swing Rectangle2D.double

Hi Gurus, We have a swing application which displays a lot of rectangles. We use Rectangle2D.double class to draw the rectangles on a JPanel. My requirement is this. Upon clicking the rectangle, I have to pick an image from the local filesystem and show it in a popup window or a frame. My question is how can I provide a hyperlink or butt...

How are very large JEE web sites structured?

A best practice question - how are very large websites best structured with Java. I'm interested in knowing how the deployments themselves are structured - Some possible answers: A single Ear - with/without session sharing in between the constituent wars? Multiple Wars - with/without session sharing? Multiple modules that are asse...

Can GWT be configured to create cache files in other location than the user's home folder?

I have a large project which I am compiling with GWT. During this process GWT generates some cache files in C:\Documents and Settings\[UserDir]\Local Settings\Temp\. For example: gwt60627byte-cache (86,321 KB) gwt60628byte-cache (4,445 KB) gwt60629byte-cache (53,773 KB) gwt60696byte-cache (8,111 KB) gwt60697byte-cache (572,777 KB) I k...

Objects in JPA ElementCollection as keys

I have a class User that can have many loginNames: @Entity public class User { @ElementCollection private List<String> logins = new ArrayList<String>(); } I want to ensure that each login is unique in the system when a user registers. When someone logs in the user object should be found by the login name. So the elements in the ...

Hibernate computed property and SQL-Queries

Hi, I've implemented a computed property to my configuration which works fine if I'm using HQL only. Sadly there are places where SQL-Queries are executed which I can't build into HQL. Am I facing a bug or just doing something wrong? <property name="customerNr" type="int" insert="false" update="false" lazy="false"> <formula> (SELECT DI...

Event thread in java

I want to create a background Thread handling some tasks (Runnable) and executing them in the order in which they are posted. Important : these tasks must NOT be executed on the Event Dispatcher Thread. Something like : BackgroundEventThread backgroundEventThread = new BackgroundEventThread(); then, later, and in many places in the...

eclipse and cygwin

i am trying to run a program in hadoop-0.20.1 with cygwin. while starting the 5 nodes my datanode,jobtracker and tasktracker are getting shut down automaticaly. what could be the reason? the name node and secondarynamenode are not starting fully as well. ...

Does Google-Collections work with GWT?

I was just reading my news when I stumbled on Google-Collections project. Does this work with GWT? ...

Guava libraries and GWT

Just discovered the Guava libraries project. Do these work with GWT? ...

Message Dialog Box Reappears After OK button is clicked

Hi, After getting good help previously, I have completed my Minesweeper game. However, there is one problem that I can't figure out. The game itself works fine, however, I have an option for the user to change difficulty setting (beginner, intermediate, advanced) which is giving me grief. The user selects "Game" from the JMenuBar and the...

Is there any way to state that a field of an entity class is not a persistent attribute?

The question is in the title. Some explanation: I can't implement necessary mapping. But I can get all necessary data using queries in DAOs. So, I want to insert that data manually to my entity in DAOs findAll () method. But JPA treats all entity's fields as persistent attributes and adds them to generated sql-queries. Of course, I get...

javac help document garbled on the terminal of mac

When issue the command "javac" on the terminal of mac,the java help document is garbled. zhang-zhongdemacbook:~ zhangzhong$ javac ?÷???javac <ѡ??> <Դ?ļ?> ???У????ܵ?ѡ??????? -g ???????е?????Ϣ -g:none ???????κε?????Ϣ zhang-zhongdemacbook:~ zhangzhong$ javac -version javac 1.6.0_13 zhang-zhon...

How can an EJB parallelize a long, CPU intensive process?

The application has a CPU intensive long process that currently runs on one server (an EJB method) serially when the client requests it. It’s theoretically possible (from a conceptual point of view) to split that process in N chunks and execute them in parallel, as long as the output of all parallel jobs can be collected and joined toge...

Can I have Eclipse close all my projects when I exit?

I would like to have Eclipse (3.5, if that matters) close any open projects I have before I exit my workspace. Is this possible? ...

spring mvc servlet initialization

Hi, I am new to spring MVC. I am looking for a place in my spring mvc applicationwhere I can initialize all sorts of things in the application. usually I did that in the init() method of the my main servlet but now the dispatcher servlet is of spring and I cannot overide the init function. what is the best practice? Thanks. ...