Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Login.jsp
- <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
- pageEncoding="ISO-8859-1"%>
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title>Insert title here</title>
- </head>
- <body>
- <form action="Validation.jsp" method="get">
- <table>
- <tr>
- <td>Username:</td>
- <td><input type="text" name="user"></td>
- </tr>
- <tr>
- <td>Password:</td>
- <td><input type="password" name="pwd"></td>
- </tr>
- <tr>
- <td><input type="submit" value="Submit"></td>
- </tr>
- </table>
- </form>
- </body>
- </html>
- ?????????????????????????????????????????????????????????
- Validation.jsp
- <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
- pageEncoding="ISO-8859-1"%>
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title>Insert title here</title>
- </head>
- <body>
- <%
- String str1=request.getParameter("user");
- String str2=request.getParameter("pwd");
- if(str1.equals("khush") && str2.equals("khush"))
- {
- RequestDispatcher rd=request.getRequestDispatcher("HelloWorld.jsp");
- rd.forward(request, response);
- }else
- {
- response.sendRedirect("Login.jsp");
- }
- %>
- </body>
- </html>
- HelloWorld.jsp
- <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
- pageEncoding="ISO-8859-1"%>
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title>Insert title here</title>
- </head>
- <body>
- <%String s=request.getParameter("user"); %>
- Welcome Your <%= s %>
- </body>
- </html>
Add Comment
Please, Sign In to add comment