Java

Technologies based on Sun's Java platform.

I'm glad to see the StAX documentation is well proffread

I'm glad to see the Java StAX documentation is proffread - because it certainly isn't proofread.

Two examples are below, one from XMLStreamReader, and another from XMLOutputFactory.

Topics: 

Converting the http_proxy environment variable to Java settings via script

Since this involves some shell parameter expansion magic, I've written a very simple script for copying the "http_proxy" environment variable to the Java proxy properties. Read More for the script.

Topics: 

Compiling the Spring Framework from behind a proxy

This is one of those things that turns out to be incredibly easy, if only I had realized that ages ago.

First: do not use Maven! It will not work. Instead, use Ant. (This is an important note, because I'm trying to create the Maven artifacts to include in a local repository. More on that later.)

Topics: 

Some Helpful Java Servlet Attributes That Are Presumably Documented Somewhere

I'm assuming these are documented somewhere, but they certainly weren't listed in the documentation I have.

Anyhoo:

javax.servlet.forward.request_uri - the original value returned from request.getRequestURI()
javax.servlet.forward.context_path - the original value returned from request.getContextPath()
javax.servlet.forward.servlet_path - the original value returned from request.getServletPath() (who'd have guessed?)

Topics: 

Where Are The Servlet 2.5 Javadocs?

I'm working on a project that involves Tomcat 6.0, which uses the Servlet 2.5 spec. Apparently as of Tomcat 6.0 the Tomcat team has decided that it's no longer their place to provide any API documentation, at all.

Instead they shuttle you over to Sun's site, which has them available online. And nowhere else.

Want to download just the API docs? Well, you can't. The download page tells you that if you want to get the Javadocs, you're going to start with a 110MB download. Uh, no. Not happening.

Topics: 

Java Annotations

I went looking for answers to some fairly basic questions (or so I thought) about Java annotations, and wound up having to go look through the actual language specification. It's never a good thing to wind up looking at the language specification for answers. I did find my answer, but the examples were a bit on the strange side.

// Array-valued single-element annotation
@Endorsers({"Children", "Unscrupulous dentists"})
public class Lollipop { ... }

Topics: 

Morons, Databases, and JSPs

OK, so this post is probably going to be mostly opaque to non-programmers, but that's fine. It's a rant. You don't have to understand it.

When I first inherited this web app, one of the first things I did was to move various display logic (namely, the URLs of icons) out of the database and into the display side. I did this in a somewhat "hackish" sort of way by just creating URLs named after the primary keys of the table. (A cleaner way might be to use CSS.)

Any way, time goes on and I move on to other things. Eventually I'm asked to come back and help clean some things up.

Topics: 

Working Around Slight Issues With Eclipse WTP's JavaScript Editor

So after getting spun into another infinite error loop while editing a JavaScript file, I discovered that the error dialog is thankfully modeless. I was able to save the file and close it to stop the infinite error loop.

Powertip: You can right click on files and use the "Open With" submenu to select the plain old text editor for JavaScript files.

Topics: 

TODO: better description(s)

From the package description of javax.xml.transform.stax:

Provides for StAX-specific transformation APIs. TODO: better description(s).

I just wanted to know what it is! Apparently it has to do with XSLT and the new Java Stream API for XML, whatever that is - because it doesn't contain any description, not even a "TODO."

I expect this level of documentation from random open source libraries, but I kind of expected something more from Sun.

Topics: 

Eclipse's Classpath File is Retarded

This is a somewhat obscure point, but it's absolutely retarded if you want to share Eclipse projects and not workspaces.

The classpath in Java is the path used to determine where Java libraries are located. It's used to find the code to run. Without it, the Java program can't find its libraries and therefore can't run.

Topics: 

Pages

Subscribe to RSS - Java