Client Interaction
When a Java Server Page accepts a call from a client, it stores information in two objects:
· Request object
, which encapsulates the communication from the client to the server.
· Response object
, which encapsulates the communication from the JSP back to the client.
The request and response and are from HttpServletRequest
and HttpServletResponse
interfaces defined by the javax.servlet.http
package.
The request Object:
The request
Object allows a JSP page access to:
· Information such as the names of the parameters passed in by the client, the protocol (scheme) being used by the client, and the names of the remote host that made the request and the server that received it.
The response Object:
The Response
object gives the JSP page certain methods for replying to the client. It:
· Allows the JSP page to set the content length and MIME type of the reply.
response object
contains methods that allow the JSP page to manipulate HTTP-specific header information