Guest User

PROGRAM 6

a guest
Mar 6th, 2019
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.52 KB | None | 0 0
  1. INDEX PAGE--------------------------
  2. <%--
  3. Document : index
  4. Created on : Mar 6, 2019, 10:23:45 AM
  5. Author : student
  6. --%>
  7.  
  8. <%@page contentType="text/html" pageEncoding="UTF-8"%>
  9. <%@page import="java.util.Date" %>
  10. <!DOCTYPE html>
  11. <html>
  12. <head>
  13. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  14. <title>JSP Page</title>
  15. </head>
  16. <body bgcolor="pink">
  17. <center> <h1>today day and time is</h1></br>
  18. <%=new Date()%>
  19. <h2>greatest of 3 num</h2></br>
  20. <div style="background-color: plum">
  21. <form action="greatest.jsp" method="post">
  22. enter nu1:<input type="number" name="n1"/></br>
  23. enter nu2:<input type="number" name="n2"/></br>
  24. enter nu3:<input type="number" name="n3"/></br>
  25. <input type="submit" name="submit" value="compare"/></br>
  26. </form>
  27. </div></center>
  28. </body>
  29. </html>
  30. ----------------------------LOGINPAGE-------------------------------------
  31. <%--
  32. Document : loginjsp
  33. Created on : Mar 6, 2019, 11:41:31 AM
  34. Author : student
  35. --%>
  36.  
  37. <%@page contentType="text/html" pageEncoding="UTF-8"%>
  38. <!DOCTYPE html>
  39. <html>
  40. <head>
  41. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  42. <title>JSP Page</title>
  43. </head>
  44. <body>
  45. <form action="loginauthentication.jsp" method="post">
  46. username:<input type="text" name="uname" value="" />
  47. password:<input type="password" name="pwd" value="" />
  48. <input type="submit" name="submit" value="submit" />
  49. </form>
  50. </body>
  51. </html>
  52. =----------------LOGIN AUTHENTICATION--------------------
  53. <%--
  54. Document : loginauthentication
  55. Created on : Mar 6, 2019, 11:43:47 AM
  56. Author : student
  57. --%>
  58.  
  59. <%@page contentType="text/html" pageEncoding="UTF-8"%>
  60. <!DOCTYPE html>
  61. <html>
  62. <head>
  63. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  64. <title>JSP Page</title>
  65. </head>
  66. <body>
  67. <%String u=request.getParameter("uname");
  68. String p=request.getParameter("pwd");
  69. if(u.equalsIgnoreCase("bmsit") && p.equalsIgnoreCase("bmsit"))
  70.  
  71. {
  72.  
  73. %>
  74. login success.!!welcome..</p><%=u%>
  75. <jsp:forward page="index.jsp" ></jsp:forward>
  76. <%}else{ %>
  77. <span style="color: plum">invalid attempt...</span>
  78. <jsp:include page="loginjsp.jsp" flush="true"></jsp:include>
  79. <%}%>
  80.  
  81.  
  82. </body>
  83. </html>
Add Comment
Please, Sign In to add comment