Hi,
Having worked for Java for 7 years I'm now moving into a project in .net. The team I'm working in have recently used a technology stack that we are fairly happy with in the business layer and below:
Spring for dependency injection, transaction management, security and for adding interceptors and for getting the possibility to injec...
In one of our current web application we are using the getClientInfo() from a java.lang.Object reference in our Oracle Forms application which works great for egtting the client IP address of a system. However we recently started to use Windows Terminal Servers in our organization, and we are now having the problem with this code return...
What is the difference between using a BufferedReader around the StringReader in the following code vs using the StringReader only? By loading up the DOM in line 2 of both examples, it seems like the BufferedReader is not necessary?
InputSource is = new InputSource(new StringReader(html));
Document dom = XMLResource.load(is).ge...
For some reason, when I have japanese characters in the title bar that is themed with java substance, I am not able to display them. Instead it shows as squares. If I have no substance theme, I can see the japanese characters in the title bar just fine. I have found ways to show these characters in all other parts of my program except...
I am mapping my database tables to my java objects. Generally I name my tables in the plural form in that a table holding books information is called BOOKS. The java object represents however one book and should be called Book. Similarly for AUTHORS/Author etc.
On the other hand, its kind of simplistic to give the same to the domain ob...
I was trying to use the Apache Ant coretask Get to get a list of WSDLs generated by another team in our company. They have them hosted on a weblogic 9.x server on http://....com:7925/services/. I am able to get to the page through a browser, but the get task gives me a FileNotFoundException when trying to copy the page to a local file ...
I am trying to get a path to a Resource but I have had no luck.
This works (both in IDE and with the JAR) but this way I can't get a path to a file, only the file contents:
ClassLoader classLoader = getClass().getClassLoader();
printInputStream(classLoader.getResourceAsStream("config/netclient.p"));
If i do this:
ClassLoader class...
I am using PdfBox in Java to extract text from PDF files. Some of the input files provided are not valid and PDFTextStripper halts on these files. Is there a clean way to check if the provided file is indeed a valid PDF?
...
Hi,
I have the following problem: I want to send a type (java.lang.Class) over the wire and 'define' the class on the other side.
I tried like that:
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(bos);
oos.writeObject(MyClass.class);
and on the receiving end:
ByteArrayInputS...
I'd like to know your thoughts about test/mocking frameworks that are widely used and have a good level of compatibility between Java and .NET. I mean, I want to learn those tools to use in a .NET project, but I still wanna be able to apply that knowledge in Java projects.
I know there're many questions about test/mocking frameworks to...
I have a simple question about usage of Hibernate. I keep seeing people using JPA annotations in one of two ways by annotating the fields of a class and also by annotating the get method on the corresponding beans.
My question is as follows: Is there a difference between annotating fields and bean methods with JPA annoations such as @I...
Is there a way to remove the close button ("X") from the JDialog title bar?
...
I have an object m of class Method. I invoked m.getParameterTypes() to create an array params of the method's parameters.
I also have an array arr of Objects. I wanted to check if the objects in arr are of the same types as the types in params (and in the same order).
What I did was to create an array classes which includes the class of ...
Say, I have a reference to a Class object with SomeType having a static method. Is there a way to call that method w/o instantiating SomeType first? Preferably not escaping strong typing.
EDIT: OK, I've screwed up.
interface Int{
void someMethod();
}
class ImplOne implements Int{
public void someMethod() {
// do something
}
}
Cl...
Hi all,
While using DragAndDrop function on a splitter control what I see is first it
gets stuck most of the times. Also when I give the offset as +70 it moves to
the position which is 70 units away from the start of the screen. What I
understand is that it should move 70 units away from where it is now.
Any idea why this is not workin...
In Ruby I frequently use File.dirname(__FILE__) to open configuration files and such. For those that don't know Ruby, this will give the location on the file system of the file it's called from. This allows me to package libraries with data and config files and open those files with relative paths.
What's the Java equivalent of this? I...
I want a behavior similar to e.g. Firefox where the list of available tabs does only show up if at least two tabs exist.
I wasn't able to find anything like that, yet.
The best idea I had was changing the layout manually:
in case of one component, just add that to the surrounding panel
if a component is added, remove the component fr...
i'm trying to create a user interface in java? what ui builder do you suggest for me to use? Thanks.
...
hi all
i have question regarding chain exception
try{ } catch(Exception e) { throw new SomeException(); }
if i do like this
my eclipse will prompt error at line throw new SomeException();
stating "unhandled exception"
and i must put something like
try{ } catch(Exception e) {
try{ throw new SomeException()...
I'm working in Java, and I have a JPanel in a JFrame. In that JPanel, among other things, I have a JLabel that I want to make appear and disappear at will. I've tried setting visibility to true/false, adding and removing it from the JFrame and JPanel, and, having looked online, I tried validate()ing and revalidate()ing ad infinitum. What...