Advertisement
Guest User

Untitled

a guest
Mar 11th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. @WebServlet("/patient")
  2. public class PatientServlet extends HttpServlet {
  3. private static final long serialVersionUID=1L;
  4.  
  5. @override
  6. protected void doGet(HttpServletRequest request, HttpServletResponse response)
  7. throws ServletException, IOException {
  8. this.getServletContext().getRequestDispatcher("/WEB-INF/patient.jsp").forward(request,response);
  9. }
  10. }
  11.  
  12. <%@page contentType="text/html" pageEncoding="UTF-8"%>
  13. <!DOCTYPE html>
  14. <html>
  15. <head>
  16. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  17. <title>JSP Page</title>
  18. </head>
  19. <body>
  20. Sign In:
  21. <form method="POST" action="j_security_check">
  22. Username:<br>
  23. <input type="text" name="j_username" size="20">
  24. Password:<br>
  25. <input type="password" name="j_password" size="20">
  26. <br>
  27. <input type="submit" value="Sign In">
  28. </form>
  29. </body>
  30.  
  31. <%@ page session="true"%>
  32.  
  33. User '<%=request.getRemoteUser()%>' has been logged out.
  34. <% session.invalidate(); %>
  35.  
  36. <br/><br/>
  37. <a href="test">Go to Log In form </a>
  38.  
  39. <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
  40. <%@taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%>
  41.  
  42. <%@page contentType="text/html" pageEncoding="UTF-8"%>
  43. <!DOCTYPE html>
  44. <html>
  45. <head>
  46. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  47. <title>JSP Page</title>
  48. </head>
  49. <body>
  50. <h1>Hello!</h1>
  51. <a href="logout.jsp">Click here to log out </a>
  52. </body>
  53. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement