Guest User

Untitled

a guest
Jun 28th, 2018
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. Login.jsp
  2. <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
  3. pageEncoding="ISO-8859-1"%>
  4. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  5. <html>
  6. <head>
  7. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  8. <title>Insert title here</title>
  9. </head>
  10. <body>
  11. <form action="Validation.jsp" method="get">
  12. <table>
  13. <tr>
  14. <td>Username:</td>
  15. <td><input type="text" name="user"></td>
  16. </tr>
  17.  
  18. <tr>
  19. <td>Password:</td>
  20. <td><input type="password" name="pwd"></td>
  21. </tr>
  22.  
  23. <tr>
  24. <td><input type="submit" value="Submit"></td>
  25. </tr>
  26. </table>
  27.  
  28.  
  29. </form>
  30.  
  31.  
  32. </body>
  33. </html>
  34. ?????????????????????????????????????????????????????????
  35. Validation.jsp
  36.  
  37. <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
  38. pageEncoding="ISO-8859-1"%>
  39. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  40. <html>
  41. <head>
  42. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  43. <title>Insert title here</title>
  44. </head>
  45. <body>
  46. <%
  47. String str1=request.getParameter("user");
  48. String str2=request.getParameter("pwd");
  49.  
  50. if(str1.equals("khush") && str2.equals("khush"))
  51. {
  52. RequestDispatcher rd=request.getRequestDispatcher("HelloWorld.jsp");
  53. rd.forward(request, response);
  54.  
  55. }else
  56. {
  57. response.sendRedirect("Login.jsp");
  58. }
  59. %>
  60. </body>
  61. </html>
  62.  
  63.  
  64. HelloWorld.jsp
  65.  
  66. <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
  67. pageEncoding="ISO-8859-1"%>
  68. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  69. <html>
  70. <head>
  71. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  72. <title>Insert title here</title>
  73. </head>
  74. <body>
  75. <%String s=request.getParameter("user"); %>
  76. Welcome Your <%= s %>
  77. </body>
  78. </html>
Add Comment
Please, Sign In to add comment