java

Virtual functions in C# and Java

How are the virtual functions work in C# and Java ? Does it use same vtable and vpointer concept similar to C++ or is it something totally different? ...

^ operator in java

Can anyone explain the use of ^ operator in java with some examples?Thanks ...

How to mix java webstart with RMI?

I want to distribute a webstart application which uses RMI. I want to avoid to ask the user the address of the RMI server, because the website that distributes the application is also the RMI server. Furthermore, I don't know the address of the server at build time, therefore the address must be added with ad hoc configuration to the J...

JSF generic Exception Handling

If I have an exception in my business layer (e.g. a SQL exception in my JDBC connection bean) how can I propagate it with a custom message to a global error.jsp page? Please help. ...

[Java] What is the best way to check if an object is from another(say fixed) list of objects?

Currently, I create a HashMap with Object Id as key and 1 as value. And the method asks for Object/Id and checks if there is a matching key. Is that ok? Or, is(are) there better alternative(s)? ...

What is the best book to learn Spring and Hibernate

I would like to learn Spring and Hibernate in an efficient way. Next weeks, I will have a lot of time to read but I will not be in front of a computer (so it will difficult to read online tutorials for example). So, my question is : what is the best book to learn Spring and Hibernate ? Of course, I know that I'll have to practice a li...

Saxon Xalan JSP

I have a JSP which attaches a XSL to an XML document pulled from a database. The application is using the Saxon Parser but my XML needs to use the Xalan one. Can a JSP page override which parser to use? ...

BigDecimal pain

How is it that Java's BigDecimal can be this painful? Double d = 13.3D; BigDecimal bd1 = new BigDecimal(d); BigDecimal bd2 = new BigDecimal(String.valueOf(d)); System.out.println("RESULT 1: "+bd1.toString()); System.out.println("RESULT 2: "+bd2.toString()); RESULT 1: 13.300000000000000710542735760100185871124267578125 RESULT 2: 13.3...

Java 6 and JaxB 2.1

The original release of Java 6 came with JAXB 2, but I have been told that 'later' Java 6 releases ship with JAXB 2.1. Does anyone know what the first version of Java 6 to ship with JAXB 2.1 was? ...

Changing port on which an Axis web service is listening to

I have a web application running on port :80, and I have an Axis web service that is part of that web application. As such, the service is running on port :80 as well. However, for security reasons our client has asked us to change the web service port to 8080 so that they can allow access only to that port for remote consumers of the w...

Applet with JRE 1.5 (IE6) fails to open HTML page over HTTPS, works with JRE1.6

Hello, I have a small (500kb) swing applet that displays small HTML page with JEditorPane. This works nicely with most browsers and JREs, but with JRE 1.5 (IE6) it seem to display just blank. There are no error messages on java console or exceptions. Applet is able to load TXT files with all JREs just fine, with JAVA CONSOLE tracing ...

How do I separate markup from application code when building a Java website?

I'm a .NET web developer who has just been asked to produce a small demo website using NetBeans IDE 5.5. I have no experience with Java up to this point. I've followed a couple of quick tutorials, one which just uses a JSP file and another which uses a servlet. My concern at this early stage is that it looks difficult to keep my applica...

What is the Most Efficient Java-Based XSLT Processor?

I have a very large XML file which I need to transform into another XML file, and I would like to do this with XSLT. I am more interested in optimisation for memory, rather than optimisation for speed (though, speed would be good too!). Which Java-based XSLT processor would you recommmend for this task? Would you recommend any other w...

SQL exception when trying make an prepared statement

I'm trying to pass the following String to a PreparedStatement: private static final String QUICK_SEARCH = "select * from c where NAME like '% ? %'"; However, I get an SQL exception that the bind variable is missing. Any suggestions? ...

What are you looking forward to in Java 7?

Java SE 7 is the next major release for Java SE. The details are sketchy, same goes for timelines, although Alex Miller has a nice round-up, and generally a good place to start. Also, here is a summary of Java 7 update by Mark Reinhold, cheif engineer for Java SE. So, what major features scheduled for release are you looking forward t...

Generating documentation for JSP files

I would like to automatically generate documentation for jsp files, similarly to javadoc with java files. I would also to include the documentation generation in an ant build. Do you know any practical tool or method to document jsp files? ...

Changing "Favorites" Tooltip in Java Help

In my helpset file, I'm declaring a favorites view, using <view> <name>Lesezeichen</name> <label>Lesezeichen</label> <type>javax.help.FavoritesView</type> <data></data> </view> This automatically adds an appropriate button to the toolbar (in the swing application). Unfortunately, the tooltip of the button reads "Add to favorit...

Cross Platform Button Ordering in Java and Swing

I'm creating a cross platform application using Swing and Netbeans (Group Layout). Is there a trick I am missing to help develop dialogs with say OK, Cancel buttons in the correct order for different platforms - specifically Windows (OK-Cancel) and Mac (Cancel-OK), rather like the JOptionPane does? I can derive my own class from JDialog...

how can my java code read OS environment variables?

hi, this may be a very simple problem, but I couldn't find an answer googleing and I'm in a rush - so I'd appreciate fast code examples. I have an environment variable on the OS i would like to read using java code. I've tried System.getProperty, but that only seems to work for the -D variables supplied directly for the JVM. how can m...

Java or C#? What are pros/cons of one over the other?

Duplicate: http://stackoverflow.com/questions/325046/java-or-net http://stackoverflow.com/questions/295224/list-major-differences-between-c-and-java http://stackoverflow.com/questions/61559/is-c-with-net-mono-or-java-the-better-choice-for-cross-platform-development http://stackoverflow.com/questions/355060/c-vs-java-generics http://st...