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.
Most Recent jsp Faqs
- How to get the real requested URI from inside the error page?
- Can I define a method in a JSP page?
- What is the difference between request.getParameter() and request.getAttribute()?
- What is difference between page and pageContext in JSP pages?
- How to config a JSP file in web.xml?
- What is the difference between jsp:forward and response.sendRedirect?
- How to retrieve values from HTML form input elements in JSP?
Most Viewed jsp Faqs
- What is difference between page and pageContext in JSP pages?(10521)
- How to config a JSP file in web.xml?(8592)
- How to disable browser caching for a specific JSP?(7122)
- How to retrieve values from HTML form input elements in JSP?(6900)
- What is the difference between jsp:forward and response.sendRedirect?(5432)
- How to get the current JSP page name?(5407)
- What is the difference between request.getParameter() and request.getAttribute()?(4989)