Tomcat ServletFilter to reject request based on query parameter

This is useful if you have a web application developed by someone else. You want to restrict certain features, but you do not have access to the source code. In this article I am giving the source code for a ServletFilter to reject all requests containing a specific query parameter »

Modify XML

In my installer project, I needed to modify an existing configuration file in XML format. For this example, I have decided to use org.w3c.dom and javax.xml.xpath to show how you can locate, and modify elements in an XML document. First we need to create an object »

Start Java process from Java

I was working on a project where I wanted to be able to run a Java process silently, similar to a windows service or a Unix daemon process, but platform independent. I wanted to start a java executable giving it the same classpath, and class to run as the current »

Current JAR path

I wanted to write an executable JAR file, that would be able to install itself. It should copy itself to the correct location and also perform some configuration. I was writing the installation guide and found myself saying something like "copy the JAR file to this location". Why not just »