Servlet Request

The first part of a request will be the HTTP headers, followed by the parameters. Headers are the bookkeeping information supplied automatically by the browser or server, stating things like the locale, and the version of HTTP in use. Parameters are provided by the user and passed in the query string or in the form data. A parameter name is whatever name the HTML form designer gave the parameter in an attribute. It is legal for parameter or headers to have a comma-separated list of values, so you need to be alert to this possibility in your code.

Let's take a look at the classes that implement request and response objects to see what information comes and goes. We'll start with the Java class that represents an HTTP request. ...

Get Just Java™ 2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.