In this tutorial you will learn about the JSP request implicit object and its application with practical example.
JSP request implicit object
This implicit object is used to get request information like parameter, header information, remote address, server name etc. This is the HttpServletRequest object that is created by web container for each jsp request. When client requests a page then JSP engine creates a new object to represent that request.
Example:
Index.jsp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
<%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <body> <form action="Welcome.jsp"> <pre> UserName : <input type="text" name="uname"> Email : <input type="text" name="Email"> <input type="submit" value="Login"><br/> </pre> </form> </body> </html> |
Output :
Welcome.jsp: On click on Login this page will called.
1 2 3 4 5 6 7 |
<%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <body> <%= "Welcome "+request.getParameter("uname")+" Email : "+request.getParameter("Email")%> </body> </html> |
Output :