java

Conig file modification in Deployed EAR

Is it possible to edit the config files, which are in a deployed EAR? If yes, please let me know how to do that without re-deploying the EAR. ...

Java Multi threading synchronization problem?

Hi Guys, I think I have a synchronization problem...It may be too basic..Please help.. I have a thread the run method of which is below public void run() { while(true) { try { for (int i = 0; i < 100; i++) { buf.append(hello + (myint++)); } ...

accessing to image in eclipse plugin

I'm trying to set the background image of canvas using canvas.setBackgroundImage(image); How can i set the image with a *.png file that is stored in plugin's image sub-directory ? Something like this: PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_INFO_TSK) but I want to use my image file instead of t...

JAXB vs Apache XMLBeans

Anyone can tell me which one is better (JAXB or Apache XMLBeans) taking in account the performance for files bigger then 10Mb? ...

How can I pass a user name and password for calling the restful web service.

I have a restful web service running and that is a password protected application. I am using Client and WebResource in my java code to call the service. But when I am calling, I get the null principle error on the server side. Can somebody please help me how to pass the username and password in my client class. ...

Facing problem in Netbeans 6.5

Hi, I am using Netbeans 6.5 IDE. In the IDE, errors and warnings are highlighted as and when code is being written. I recently installed a plugin and since then, none of the errors are being highlighted in any code that I type in. Only after I build a project do I get to know about all the errors. The plugin I installed may have deactiv...

Gwt multiple entry point and NetBeans 6.7

I want to make an homepage with GWT that let the user log in and then I want to redirect the user to another page, that will show a table or something else (the real part of the webapp). This will also be entirely coded with GWT. Now, I'm programming with netbeans 6.7 and I don't know how to manage different entryPoint (the home and the ...

How do I call java methods on an object from a FreeMarker template?

Is it possible to call a method that takes parameters from a Freemarker template? I have an object model that I'm trying to render with Freemarker into a web page. One of the objects has a method to get a sublist of it's contents - taking a parameter that is used to filter the list: public List getunits(final String type); I know in J...

Tutorials for creating and deploying a simple java portlet in pluto 2.0

Hi! I'm new to portlets and pluto and would like to start with getting a simple hello world portlet up and running on pluto 2.0, but most of the resources I found for this are for earlier versions of pluto or not specific enough for me since I'm new to this area. The eclipse plugin also does not work for pluto 2.0 Please provide links ...

comet vs pubsub..?

may i know what is the different between these 2 approach ? can explain in lay man terms? ...

Eclipse spell checker - How do I remove a word I added?

I accidentally added a word I'm forever mis-spelling into Eclipse's spell-checker dictionary. How do I get it back out again? ...

Trusted applet security warning (yes/no) dialog not appearing in Ubuntu 8.10 and firefox.

Has anyone ever had this happen? It appears to lock the browser up until I force quit, and I have a user whose setup can reliably reproduce this, which worries me. Thoughts? ...

Java thread start() without join() or interrupt() in servlet

I have a servlet filter that carries some logic and produces output before a request is served by it's primary page. I have a new need to send out the output a few seconds later than at the moment it is generated (with ~10s delay). Because of certain poor design choices made earlier I can't move the position of the filter just to have th...

How to load properties file in Google App Engine?

So I'm trying to add some ability to my project to allow user-defined properties in my deployment artifact - a simple key:value .properties file. I place the service.properties file in war/WEB-INF/my-service.properties And in my ServiceImpl.java constructor I have the following: String propertiesFileName = "my-service.properties";...

URL Parsing in Java (with Tomcat)

I want to parse a descriptive-style URL with slashes in Java (server/books/thrillers/johngrisham/thefirm). How do I do this? Edit: My overall idea is to handle the data I receive to do a lookup (therefore using the URL as search criteria) in a database and then return a html pages with data on it. ...

What's the simplest way to store data from a java program to MySQL?

I want to store data in string form to MySQL. I have created the tables in the MySQL. I haven't worked with DATABASE ever. Can you please provide me code to store that data in the MySQL DB. e.g. Let's say I have a string "stack_overflow" and there is a column "SiteName" in a table "SiteDetails" in the DataBase. So how to store the string...

Generic deep compare equals

Basically i don't want to compare elements, but elements that thy contain. It would be cool if following would work, but it does not. public boolean equals(Ie<T> that) { T This = this.value; T That = that.value; boolean x = That.compareTo(This) == 0; return x; } What i have done is : public boolean equals(Object obj) { if (obj =...

How do you set cache headers in Spring MVC?

In an annotation-based Spring MVC controller, what is the preferred way to set cache headers for a specific path? ...

How does NetworkInterface work within a cluster?

I need to call a web service that performs work for my application. To use the service, you send a token with each request so you can later identify each job. The service provides reporting with a second call, which outputs logging-style records for all work it's performed, regardless of which client or application is fetching the report...

Not possible to launch a file on a network using Java Desktop?

I have a problem that i illustrated in this question but had no correct answers. I refined my problem and tried to edit the initial question to reflect that but i guess because of the way SO displays unanswered questions (if a question has an upvoted answer even if it does not solve your problem, the question no longer gets displayed in ...