Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @WebServlet("/patient")
- public class PatientServlet extends HttpServlet {
- private static final long serialVersionUID=1L;
- @override
- protected void doGet(HttpServletRequest request, HttpServletResponse response)
- throws ServletException, IOException {
- this.getServletContext().getRequestDispatcher("/WEB-INF/patient.jsp").forward(request,response);
- }
- }
- <%@page contentType="text/html" pageEncoding="UTF-8"%>
- <!DOCTYPE html>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <title>JSP Page</title>
- </head>
- <body>
- Sign In:
- <form method="POST" action="j_security_check">
- Username:<br>
- <input type="text" name="j_username" size="20">
- Password:<br>
- <input type="password" name="j_password" size="20">
- <br>
- <input type="submit" value="Sign In">
- </form>
- </body>
- <%@ page session="true"%>
- User '<%=request.getRemoteUser()%>' has been logged out.
- <% session.invalidate(); %>
- <br/><br/>
- <a href="test">Go to Log In form </a>
- <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
- <%@taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%>
- <%@page contentType="text/html" pageEncoding="UTF-8"%>
- <!DOCTYPE html>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <title>JSP Page</title>
- </head>
- <body>
- <h1>Hello!</h1>
- <a href="logout.jsp">Click here to log out </a>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement