Write JSP programs which can perform the following tasks: (you may create a single or multiple web pages for these tasks): (i) A page requires input of three variables a, b, and c, it then finds and displays the largest of these three variables. Write the JSP code for the above. (ii) Create a login page for students which should create two cookies namely userID and password on successful login by a student.
home.html
<form action="welcome.jsp">
<input type="number" name="a">
<input type="number" name="b">
<input type="number" name="c">
<input type="submit" value="go"><br/>
</form>
result.jsp
<%
double x = request.getParameter("a");
double y = request.getParameter("b");
double z = request.getParameter("c");
out.print("The largest of these three variables: " + Math.max(a, Math.max(b, c));
%>
Comments
Leave a comment