Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%@page import = "java.util.*" %>
- <%@page import = "java.lang.*" %>
- <%@page errorPage="err.jsp" %>
- <html>
- <title>
- LOGIN
- </title>
- <body>
- <form name = "myForm" method = "GET".
- <%! String usename;
- String Password;
- String returnDate()
- {
- Date today = new Date();
- return today.toString();
- }
- %>
- <br>
- <br>
- Username: <input type = "textbox" name = "un"
- value: size = "25">
- <br>
- <br>
- Password: <input type = "password" name = "pwd">
- <p>
- <input type = "submit" value = "login">
- <input type = "reset">
- </form>
- <%
- String user = request.getParameter("un");
- String pwd = request.getParameter("pwd");
- if(user!=null && pwd!=null)
- {
- if("Vj".equals(user) && "Teja".equals(pwd))
- {
- out.println("Authentication complete");
- }
- else
- {
- throw new Exception("Login Failure");
- }
- }
- %>
- </html>
- <%@ page isErrorPage="true" import="java.io.*" %>
- <html>
- <body>
- <h2>Error Encountered!</h2>
- <font color="red"><%= exception %> has been encountered.</font>
- </body>
- </html>
Add Comment
Please, Sign In to add comment