I'd encourage you to take a look at the docs for ServletRequest. In there are many of the methods you want. Additionally, you need to take a look at the HTTP RFC to see the standard HTTP header names. For example, the (optional) user agent is specified as "User-Agent". Are you converting this from a CGI script? That is what your variables look like.