edit form example

This commit is contained in:
nnhai1991@gmail.com 2018-08-22 23:19:31 +08:00
parent 221ecbdae6
commit fe7b8bf4ba
2 changed files with 3 additions and 6 deletions

View File

@ -1,17 +1,13 @@
package org.baeldung.security;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Controller
@RequestMapping("/")
public class HomeController {
@GetMapping
@RequestMapping
public String home() {
return "home";
}

View File

@ -25,9 +25,10 @@
<sec:authorize access="hasRole('ADMIN')">
Manage Users
</sec:authorize>
<form>
<form method="post">
<sec:csrfInput />
Text Field: <br /> <input type="text" name="textField" />
<input type="submit" value="Submit form with CSRF input">
</form>
<sec:authorize url="/userManagement">
<a href="/userManagement">Manage Users</a>