I need to use some 3rd party jar in my project. The project is a Spring project and the jar is also using Spring.
Is there a way by which I can include the 3rd party jar in my project? I am finding it difficult to find each and every dependency of the 3rd part jar and inject it.
...
In Java: Which is the most performance code and why?
if (x==1) {
....
} else if (x==2) {
....
} else if (x==3) {
....
} else if (x==4) {
....
}
... rest code here...
or
try {
if (x==1) {
...
throw MyException(1);
}
if (x==2) {
...
throw MyException(2);
}
if (x==3) ...
Hi,
i cannot use any bean value in my custom control.:
for instance:
this is my foo.taglib.xml file.
<facelet-taglib>
<namespace>http://www.penguenyuvasi.org/tags</namespace>
<tag>
<tag-name>test</tag-name>
<component>
<component-type>test.Data</component-type>
</component>
</tag>
</facelet-taglib>
faces...
I have a servlet based application for serving stored documents and images. The images were all stored as jpg with standard sizes based on corporate standards at the time the system was designed. Now, the image sizes that users want to see have changed. Since there are many images that won't need to be resized, we have built a service...
Hi,
How can i get array list of custom object from web service?
I define a method that returns a list like this : ArrayList<Car> getVehicle() {...}
But in client ws, I receive an ArrayList of objects...
It seems I can't cast it even by copying custom class to client jar file of my applet, like serialized object...
How can i do that?...
Hi,
I'm trying to write a client-server application in Java with an XML-based protocol.
But I have a great problem!
See this part of client code:
InputStream incoming = skt.getInputStream(); //I get Stream from Socket.
OutputStream out = skt.getOutputStream();
[...]
XMLSerializer serializer = new XMLSerializer();
//This create an XML...
We are currently leveraging a third party tool to convert pdf files into gifs and displaying them in the browser. We have been adjusting the DPI of these images so that when printed they will look as close as possible to what the original pdf looked like. We've found that at least a setting of 300 DPI matches roughly the clarity of what ...
I am streaming binary data (a CSV file extracted from the database as a Clob) to the browser by calling response.getOutputStream() and would normally wrap the OutputStream in a BufferedOutputStream when copying the data.
Should I close the BufferedOutputStream or will this also close the underlying OutputStream?
[Extra question: Do I n...
I have two AWT components in a Frame, Panel A and Panel B. I would like panel A to be sized to the height width of the frame (and maintain that size on frame resize), but I would like panel B to overlap A. B will be at a fixed position (0,0 to make it easier) with a fixed height and width. I'm not sure what kind of layout manager I would...
The title of this is kind of awkward; I wasn't really sure how to sum this up. I know how I can do this, I'm just not sure how to do it efficiently. Here's my problem:
I have a string as input. Let's say:
foo bar
And I have a very large set of strings (tens of thousands). Let's say:
foo, baz, bar, blah, foo bar, foo baz
I...
So far I know that these keywords are valid for beginning a java source file:
class, public, import, package, interface, and final
Additions from comments: abstract, strictfp, enum
Are there any more?
(Thanks for all the super quick responses! Feel free to edit this to add more that are found.)
...
I'm trying to figure out what bits I need to plug together to marshal a JAXB POJO to a XOM document, and vice versa.
The JAXB Marshaller interface's marshal methods take various targets, such as Result, but none of them have a XOM adapter. Irritatingly, the XOM API does have a XOMResult implementation, but it's package protected, and on...
I was just thinking that when should I actually consider loading more than one application contexts in Spring? All so far I have been merging the context files with <include> such that only one application context loads up.
Do you have an idea about when to go for more than one application contexts in the same JVM?
...
Eclipse's normal Java perspective seems to hide Referenced Libraries just fine (in a "Referenced Libraries" folder in your project). Unfortunately, the Java EE perspective does not seem to have this same feature and enabling it is non-intuitive.
Can anyone shed some light on this issue?
...
Hello all! I have a slight problem. Having recently migrated on Mac, I've been pulling my hair and searching the web about this but have not found what I was exactly searching for. I want to set the application name in the system menu, which doesn't work at the moment (my main class name is displayed instead of my app name). What propert...
Hi Guys
Just curious to know (in as much detail as possible), why is it a bad practice to
modify the object while using it as a lock.
//Assuming the lockObject is globally available
synchronized(lockObject){
lockObject.someMutativeOperation(...);
}
Cheers
...
If I have a bunch of custom JComponents in a Swing panel, and each of them can contain many other JComponents, is there a way to "freeze" repaints on the top level components and then unfreeze them, triggering a repaint?
I guess I am trying to do sort of a localized double-buffering.
...
Do I have to take a look at the java api everytime I instantiate an object / call a method from a class in it? Also, do I always have to know which classes are in the java api and which are not?
...
Hi all,
Just a quick question really. Say I have a 10x10 array in Java, some of the places in which are not used, and I'm needing to go through all elements as part of a method. Would it be better to:
Go through all elements with 2 for loops and check for the nulltype to avoid errors, e.g.
for(int y=0;y<10;y++){
for(int x=0;x<10;x...
Hi, all.
One of my applications runs on a Windows Service instance of Tomcat 5.5, running Java 1.6. We've got an issue in the code where the application creates a NullPointerException if a SOAP request times out.
We had an issue, this morning, where the component on the other side of the SOAP request was unavailable. The result was a...