Write a JAVA JSP Program to implement verification of a particular user login and display a welcome page.
Index.html
<html>
<head>
<title>JSP Page</title>
</head>
<body>
<form method="post" action="lab5a.jsp" >
<h1>
User name <input type="text" name="uname" />
<br>
Password <input type="password"
name="pwd" />
<input type="submit" value="Login" />
</h1>
</form>
</body>
</html>
lab5a
<html>
<head>
<title>JSP Page</title>
</head>
<body>
<%
String u=request.getParameter("uname");
String
p=request.getParameter("pwd");
if
((u.equals("admin"))&& (p.equals("rose")))
out.println("Welcome
"+u+" you are authenticated");
else
out.println("Failed
Login Attempt");
%>
</body>
</html>
No comments:
Post a Comment