Java Projects

Java Libraries

Expression Evaluator

A library to parse and evaluate mathematical expressions, including the ability to call functions implemented (by you) in Java.

Updated 2008-06-20: released under the GNU Lesser General Public License (LGPL).

Get the binary and source (1.2MiB zip or 800KiB tar.gz) (950k - includes source, javadoc, pre-built JAR, and dependent libraries - ANTLR, jmock and junit).
See the Javadoc.

zipcodes

A Java library (and data files) for looking up US postal codes and performing distance operations on them. (Updated 2007-04-25: latitude and longitude were being read from the data file inverted).

Get the java source code (700k - includes source, javadoc, and pre-built JAR).
See the Javadoc.

TestURLConnection

A Java library that allows developers to easily test code that uses Java's java.net.URL class to access resources. It provides a URL protocol that will return object that the developer can control by implementing an interface.

You can find everything on SourceForge.net under the TestURLConnection project.

JSP Utilities

SessionSnooper

SessionSnooper allows you to browse request headers and request-, session-, and application-scoped attributes.

It requires that you also have htmlescape.jsp, httpheaderreferences.jsp, and util.jsp in the same directory so they can be included.

Once you have the include files mentioned above, you can simply copy the JSP file into your webapp and start using it. I recommend limiting access to it, since it can display a lot of information about your running application.

RequestDumper

Similar to the SessionSnooper, RequestDumper allows you to browse request headers, parameters, and attributes.

For debugging purposes, you could put it at the end of a request forwarding chain to verify your assumptions about the state of the request at the end of processing.

It requires that you also have htmlescape.jsp, httpheaderreferences.jsp, and util.jsp in the same directory so they can be included.

Once you have the include files mentioned above, you can simply copy the JSP file into your webapp and start using it. I recommend limiting access to it, since it can display a lot of information about your running application.

AdHocQuery

Allows users to submit ad-hoc SQL queries to their database and display the results in HTML form.

It requires that you also have htmlescape.jsp in the same directory so it can be included.

Once you have the include file mentioned above, you can copy the JSP file into your webapp. You will have to modify the getConnection method to suit your needs. I highly recommend limiting access to it, since it gives users access your database (!) and they can even run queries that can really lock up your machine. I also recommend using a JDBC connection pool whose connections are configured to only allow SELECT queries, so that information cannot be modified using this JSP.