How to pretty print Java objects to XML

Introduction In this article, I will show how to pretty-print XML from Java objects. Generally and loosely speaking, the process of converting an object into a sequence of bits so that it can be stored on a storage medium or transmitted across a network is referred to as serialization, marshalling, or deflating, and going the […]

How to modify request headers in a J2EE web application.

Request headers may be modified in a J2EE web application (webapp). By “modify” I mean to add, remove, or edit the request headers. The “hooks” are to 1) subclass javax.servlet.http.HttpServletRequestWrapper and 2) implement the javax.servlet.Filter interface. Notice that the code will be written against the standard Servlet API; this means that your code is portable […]