Skip to content

Instantly share code, notes, and snippets.

@pikanji
Last active December 11, 2015 18:48
Show Gist options
  • Save pikanji/4644106 to your computer and use it in GitHub Desktop.
Save pikanji/4644106 to your computer and use it in GitHub Desktop.
Sample codes for blog post: http://kurotofu.sytes.net/kanji/fool/?p=970
-<p><a href="<c:url value='/spring_security_login' />">Login</a></p>
+<p><a href="<c:url value='/login' />">Login</a></p>
@RequestMapping(value = "/login", method = RequestMethod.GET)
public String login() {
return "login";
}
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page session="false" %>
<html>
<head>
<title>Login</title>
</head>
<body>
<h1>My Login Page</h1>
<form action="<c:url value='j_spring_security_check' />" method="POST">
<label>User Name : </label>
<input type="text" name="j_username" value="" /><br />
<label>Password: </label>
<input type="password" name="j_password" value="" /><br />
<input type="submit" value="Login" />
</form>
</body>
</html>
- <http auto-config="true" />
+ <http auto-config="true">
+ <form-login login-page="/login" />
+ </http>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment