FAQ


Advertisement



How can you access HTTP request/response information in JSP?

HTTP requests contain information sent to the JSP from the client. For example, if the JSP page is invoked by a form, the JSP must access the form data stored in the request before processing. The form data might contain login information used to verify a user, registration information written to a database, or information about a product added to a user's shopping cart.

In a JSP, you can access HTTP request information by using the implicit JSP object request. You can use the same methods with the request object as you can with the javax.servlet.HttpServletRequest object.

JSP answer a request by constructing an HTTP response and sending that response back to the client. Within your JSP, you access the HTTP response to write information within the response that is sent back to the client.

In a JSP, you can access and construct HTTP response information by using the implicit JSP object response. You can use the same methods with the response object as you can with the javax.servlet.HttpServletResponse object. The HTTP response includes an output stream for sending results back to the client.


Printer-friendly version Printer-friendly version | Send this 
article to a friend Mail this to a friend

Previous Next vertical dots separating previous/next from contents/index/pdf Contents

  |   |