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 »

JavaScript functions as arguments, and return values

The definition of lambdas is just anonymous functions that are passed as arguments to functions, or returned as results of function calls. The lambda defines the function, but does not execute it. It is executed by the function it is passed to with arguments decided by that function. Function as »

AJAMU now supports Internet Explorer and Safari

AJAMU issue #1, and issue #2 are now resolved. I first described AJAMU in this post: Use Ajax in HTML; AJAMU These fixes will be in release v0.3 planned for end of February 2015. If you can't wait that long, and want the fix now, you can get the »

Referrer spam

Have you wondered why you have thousands of page views according to Google Analytics, but Google AdSense only shows a few? That happened to me. First I thought that Google was mistakingly not counting my web site visitors in Google AdSense. Here is what I observed Why do they do »

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 »