Hi,
I have been working on Eclipse recently. I am fairly new to java programming, so this question might seem novice to some.
I have been working on projects which have references to many other projects. So, when I create the project in my eclipse environment, it shows errors on many places, as I believe it is not able to pick-up all t...
We have problems with JVMs running internet applications under changing load. This problem comes and goes. One day we see three VMs dying and after that, there is nothing for a week or two. We have not found a pattern yet, found nothing to reproduce or cause it. Also a search in the Sun bug database did not help.
We tried a suggested wo...
I ran across some code recently at work (recreated to be similar to what I am dealing with) similar to the code below
Is there a way I can rework the code below to use one data structure (with performance in mind)?
Here is some code to illustrate what I mean:
public class ObjectMapper {
private Map<UUID,Integer> uuidMap;
pri...
I'm working on a web application that uses Spring MVC 2.5 and Hibernate.
One of the requirements of the application is that it must be able to export some objects to an external database. I figure I might as well use my existing data layer and just save the objects to the external source.
I'm new to Spring and Hibernate, and I guess I...
I want to write a JAR file that makes use of the javax servlet API. If I write against version 2.2, does that mean it will work on versions 2.3, 2.4 and 2.5?
Thanks
...
With Spring MVC, you can specify that a particular URL will handled by a particular method, and you can specify that particular parameters will map to particular arguments, like so:
@Controller
public class ImageController {
@RequestMapping("/getImage")
public String getImage( @RequestParam("imageId") int imageId, Map<String,Obje...
I'm using replaceAll() on a string to replace any letter with "[two letters]". So xxxaxxx to xxx[ab]xxx. I don't want the ones that have already been replaced to be done again (turns to xxx[a[cb]]xxx)...
An easy way to do this would be to exclude any letters that are proceded by a "[" or followed by "]". What's the correct Regex to use?...
More specifically, is there any Java plugin frameworks have all of the below features:
Support for multiple JAR files
JARs can be signed and/or sealed
Can perform a license check for each JAR prior to instantiation
Can load multiple JARs using multiple threads
...
I need to detect java version in browser, I have used deployJava.js file to detect java.
I think there is definitely a problem , the way deloyJava.js ( java detection and deployment helper file from Sun) works with Safari on Windows.
You can see the problem in action if you go to official java verification page (http://www.java.com:80/...
I understand that only one instance of any object according to .equals() is allowed in a Set and that you shouldn't "need to" get an object from the Set if you already have an equivalent object, but I would still like to have a .get() method that returns the actual instance of the object in the Set (or null) given an equivalent object as...
How do you determine if a thread is running?
...
There is a lot of talk on the internet about how Maven is bad. I have been using some features of Maven for a few years now and the most important benefit in my view is the dependency management.
Maven documentation is less than adequate, but generally when I need to accomplish something I figure it out once and then it works (for exam...
Is the Java Virtual Machine really a virtual machine in the same sense as my VMWare or Parallels file?
...
In Java, you can load all kinds of resources using the same API but with different URL protocols:
file:///tmp.txt
http://127.0.0.1:8080/a.properties
jar:http://www.foo.com/bar/baz.jar!/COM/foo/Quux.class
This nicely decouples the actual loading of the resource from the application that needs the resource, and since a URL is just a Str...
I am playing with Google's AppEngine Java support. I have a fairly simple set of JSP pages, and was looking at the logs today, and saw that I was getting a BufferOverflowException from the following JSP file:
<%
response.sendRedirect("index.jsp");
%>
I simplified the file to just this, and I still get the error. Any ideas?
Here is th...
Hi,
I am calling a Web Service and i want it to respond within 5 seconds. If it can't process it in 5 secs (ignoring network latency) i want it rollback the transaction and send me a Timeout exception.
I can see timeouts being set only on the Calling Client's code. I want this to be enforced by the Web Service Implementer (Server side)...
Is there a way of preserving the natural size of a JButton in the center of a BorderLayout? Right now, it expands in all directions to fill it up, but I want it normal size.
If it isn't possible, how can I get a button to be in the center of a panel with its normal size?
...
I couldn't find any suitable documentation for the same. In any case, which is the best way to generate trace reports while running a JVM process (a tool provided by SUN in its JDK bundle preferably) so that any JVM crashes can be logged?
Thanks in advance,
z0ltan
...
I'm using POI HSSF API for my excel manipulations in Java. I've a date value "8/1/2009" in one of my excel cell and while I try to read this value using HSSF API, it detects the cell type as Numeric and returns the 'Double' value of my date. See the sample code below:
cell = row.getCell(); // date in the cell '8/1/2009'
switch (cell.get...
I have a JPanel, which I would like to detect the following events
(1) When the mouse move in
(2) When the mouse move out
The (1) is quick easy. (2) is a bit tricky. Currently, I have to register event at all the components around JPanel. If the neighbor around JPanel detected a mouse move in event, this also means that JPanel is havi...