The JSP request is an implicit object of type HttpServletRequest.
It is being created for each jsp request by the web container.
It represents the request made by the client.
It is one of the argument of the service method.
It can be used to retrieve request parameters,cookies,request attributes,header information etc.
Example GetName.html
It is being created for each jsp request by the web container.
It represents the request made by the client.
It is one of the argument of the service method.
It can be used to retrieve request parameters,cookies,request attributes,header information etc.
Example GetName.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML> <BODY> <FORM METHOD=POST ACTION="RetrieveRequestParameters.jsp"> What's your name? <input type=text name=username size=20> What's your e-mail address? <input type=text name=email size=20> What's your age? <input type=text name=age size=4> <P><INPUT TYPE=SUBMIT> </FORM> </BODY> </HTML>RetrieveRequestParameters.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title> </head> <body> You entered Name: <%= request.getParameter("username") %> Email: <%= request.getParameter("email") %> Age: <%=request.getParameter("age") %> </body> </html>When you click on Submit Query button,this output will appear.