Why does HttpServlet throw an IOException?
I get why an HttpServlet would throw ServletException, but why IOException? What was the reasoning behind this? ...
I get why an HttpServlet would throw ServletException, but why IOException? What was the reasoning behind this? ...
For a current project the decision has to be made whether to use XML and an XSL-transformation to produce HTML or to directly use HTML-templates. I'd be interested in arguments for or against the XSL-approach. I understand that in cases where you have to support many different layouts, an XSL-solution has a lot of advantages, but why wo...
This is a long shot, but does anyone know of an algorithm for estimating and categorising text width (for a variable width font) based on its contents? For example, I'd like to know that iiiiiiii is not as wide as abcdefgh, which in turn is not as wide as WWWWWWWW, even though all three strings are eight characters in length. This is a...
I'll be interviewing for a J2EE job using the Spring Framework next week. I've used Spring in my last couple of positions, but I probably want to brush up on it. What should I keep in mind, and what web sites should look at, to brush up? ...
So we all know that all classes implicitly extend Object. How about interfaces? Is there an implicit super-interface? I say there is. The following code compiles: java.io.Serializable s1 = null; java.io.Serializable s2 = null; s1.equals(s2); The equals method is not declared in Serializable, but in Object. Since interfaces can only e...
Hi, I'd like to convert this SimpleFormController to use the annotation support introduced in Spring MVC 2.5 Java public class PriceIncreaseFormController extends SimpleFormController { ProductManager productManager = new ProductManager(); @Override public ModelAndView onSubmit(Object command) throws ServletE...
I recently migrated my web services from Axis to CXF (2.1). It appears that while Axis needed the "axis.socketSecureFactory" set, CXF grabs the default. How do I set the default SocketFactory in Java to my own implementation (such as a property)? What I am not looking to do is to set the default SocketFactory properties like setting t...
With the type Integer you can do this: int lowest = Integer.MIN_VALUE; What can I do if I use generics? K lowest = <...>; I need this in order to implement something similar to a PriorityQueue. I have access to a node I want to remove from the queue, but it is not the min. 1. I need to make it the min by decreasing the key of that...
The following instruction Selenium.typeKeys("location", "gmail.com"); types the string gmailcom instead of gmail.com. What's happening there? From the comments: I am trying to simulate autofill and the only way to do it currently on selenium is to combine type and typeKeys. eg: selenium.type("assigned_to", split[0]+"@"); selenium.t...
If I just add <aop:aspectj-autoproxy proxy-target-class="false"/> to the start of my spring context, every single bean that implements an interface gets a JDK proxy. I would really like to limit the proxying A) to classes that actually need proxies or B) classes that I specify as needing proxies. I tried using the aop:scoped-proxy stanz...
Once upon a time there was a class: public class Scope<C extends Cloneable & Comparable<C>> implements Comparable<Scope<C>>, Cloneable, Serializable { private C starts; private C ends; ... @SuppressWarnings("unchecked") @Override public Object clone() { Scope<C> scope; try { scope = (Scope<C>...
On setVisible(true), I call the following code to start a modal dialog: private synchronized void startModal () { try { if (SwingUtilities.isEventDispatchThread()) { EventQueue theQueue = getToolkit().getSystemEventQueue(); while (isVisible()) { AWTEvent event = theQueue.getNextEvent(); Object source = ...
I only see a Queue interface, is there no Queue class in the Java Collections? ...
I need a window for my application that allows the user to: see currently existing users create new users change permissions delete users view users details While trying to find a perfect way to create a good user experience, I stumbled upon various different approaches: Dialog Based, Tree Based, etc... I've decided to go with that:...
Hello, I created my own build.xml which got: <target name="compile"> <mkdir dir="build"/> <javac destdir="build"> <src path="src"/> </javac> </target> <target name="build" depends="compile"> <mkdir dir="dist"/> <jar destfile="dist/app.jar" basedir="build" /> </target> <target name="run" depends="compile"> ...
Hello! I encounter a totally strange behavior of the Java compiler. I can't cast a supertype to a subtype when cyclic generic type relation is involved. JUnit test case to reproduce the problem: public class _SupertypeGenericTest { interface ISpace<S extends ISpace<S, A>, A extends IAtom<S, A>> { } interface IAtom<S extends ISpac...
I am working on a project using Spring Web Flow 2.0. I am trying to unit test a flow that begins with a decision state. The decision state checks the value of an object that is on the conversationScope. I cannot figure out how to insert a value into the conversationScope for the unit test. I have tried: getConversationScope().put("...
Hey, what is a cool blogging engine for GAE? I really like wordpress, but PHP isn't available on the GAE. Which blogging systems do you use on GAE? Which experiences you have made with it? Thanks. ...
While this may seem simple, i have tried the usual request.getRemoteAddr(), request.getRemoteHost() but i keep getting my servers address. Something about my configuration, im getting my gateway ip. Does anyone know how to get the acutal users IP address? thanks ...
While trying to discover the max size of a Java String array on my machine I ran into some interesting results, here is the code, String [] max; int i = 15444000; while(true){ try{ max = new String[i]; System.gc(); Thread.sleep(10); }catch(InterruptedException e){} i += 1; System.out...