Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @WebServlet("/logincontrol")
- public class SessionController extends HttpServlet {
- private static final long serialVersionUID = 1L;
- public SessionController() {
- super();
- }
- @RequestMapping(value="/logincontrol")
- protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
- request.getSession().setAttribute("name",request.getParameter("password"));
- response.getWriter().println("Hello World!");
- }
- }
- <form name="loginForm" action="logincontrol">
- <table>
- <tr>
- <td>User:</td>
- <td><input type='text' name='name'></td>
- </tr>
- <tr>
- <td>Password:</td>
- <td><input type='password' name='password' /></td>
- </tr>
- <tr>
- <td colspan='2'><input name="submit" type="submit"
- value="submit" /></td>
- </tr>
- </table>
- <%--
- <input type="hidden" name="${_csrf.parameterName}"
- value="${_csrf.token}" /> --%>
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement