Sunday, 25 March 2018

jsp program to display login page


 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

PUBLISHER & SUBSCRIBER PATTERN

Using the UML Drawing Tool by implementing the code in Java demonstrate the Observer  Design Pattern. The Publisher-Subscriber desig...