Implicit Objects in JSP, Request Implicit Object in JSP, Methods of Request Objects in JSP
request is the object of HttpServletRequest interface, which is used to get the request from the client and can be used to send the request from one JSP page to another JSP page. The request object has some methods to do these tasks like for getting the request from the client, the some important methods of request object are as follows-
Some of other methods are also avalable with request object but those are rarely used.
Example for getting the request from the client
client.html
<html>
<form method="post" action="printValue.jsp">
<input type="text" name="val">
<input type="submit" value="sendValue">
</form>
</html>
server.jsp
<html>
<%
String val=request.getParameter("val");
out.print("The Value you have send "+val);
%>
</html>
Thanks for Visiting
request is the object of HttpServletRequest interface, which is used to get the request from the client and can be used to send the request from one JSP page to another JSP page. The request object has some methods to do these tasks like for getting the request from the client, the some important methods of request object are as follows-
- request.getParameter(String name)
- request.getQueryString(String querystring)
- request.getAttribute(String attribute)
- request.setAttribute(String att_name,ObjectAtt_value)
- request.getParameterNames()
- request.getParameterValues()
Some of other methods are also avalable with request object but those are rarely used.
Example for getting the request from the client
client.html
<html>
<form method="post" action="printValue.jsp">
<input type="text" name="val">
<input type="submit" value="sendValue">
</form>
</html>
server.jsp
<html>
<%
String val=request.getParameter("val");
out.print("The Value you have send "+val);
%>
</html>
Thanks for Visiting
{ 0 comments... read them below or add one }
Post a Comment