Implicit Object in JSP, out Object in JSP, What is the Use of out Object in JSP
out is the object of JspWriter class in JSP, it is similar to the PrintWriter class in JSP. It is used to print any string on the browser or client as a response.
Example for out Object:-
login.html
<html>
<head><title>Login Here</title></head>
<form method="post" action="loginValidate.jsp">
<input type="text" name="user"><br>
<input type="password" name="pass"><br>
<input type="submit" value="login">
</form>
</html>
loginValidate.jsp
<%
if(request.getParameter("user").equals("admin")&&request.getParameter("pass").equals("admin"))
{
out.write("Hello "+request.getParameter("user"));
}
out.write();
%>
Thanks for Visitingout is the object of JspWriter class in JSP, it is similar to the PrintWriter class in JSP. It is used to print any string on the browser or client as a response.
Example for out Object:-
login.html
<html>
<head><title>Login Here</title></head>
<form method="post" action="loginValidate.jsp">
<input type="text" name="user"><br>
<input type="password" name="pass"><br>
<input type="submit" value="login">
</form>
</html>
loginValidate.jsp
<%
if(request.getParameter("user").equals("admin")&&request.getParameter("pass").equals("admin"))
{
out.write("Hello "+request.getParameter("user"));
}
out.write();
%>
{ 0 comments... read them below or add one }
Post a Comment