edit form example
This commit is contained in:
parent
221ecbdae6
commit
fe7b8bf4ba
@ -1,17 +1,13 @@
|
|||||||
package org.baeldung.security;
|
package org.baeldung.security;
|
||||||
|
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("/")
|
@RequestMapping("/")
|
||||||
public class HomeController {
|
public class HomeController {
|
||||||
|
|
||||||
@GetMapping
|
@RequestMapping
|
||||||
public String home() {
|
public String home() {
|
||||||
return "home";
|
return "home";
|
||||||
}
|
}
|
||||||
|
@ -25,9 +25,10 @@
|
|||||||
<sec:authorize access="hasRole('ADMIN')">
|
<sec:authorize access="hasRole('ADMIN')">
|
||||||
Manage Users
|
Manage Users
|
||||||
</sec:authorize>
|
</sec:authorize>
|
||||||
<form>
|
<form method="post">
|
||||||
<sec:csrfInput />
|
<sec:csrfInput />
|
||||||
Text Field: <br /> <input type="text" name="textField" />
|
Text Field: <br /> <input type="text" name="textField" />
|
||||||
|
<input type="submit" value="Submit form with CSRF input">
|
||||||
</form>
|
</form>
|
||||||
<sec:authorize url="/userManagement">
|
<sec:authorize url="/userManagement">
|
||||||
<a href="/userManagement">Manage Users</a>
|
<a href="/userManagement">Manage Users</a>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user