security work - expressions
This commit is contained in:
parent
0a2381468c
commit
29608c0b36
@ -1,5 +1,4 @@
|
|||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>org.baeldung</groupId>
|
<groupId>org.baeldung</groupId>
|
||||||
<artifactId>spring-security-login</artifactId>
|
<artifactId>spring-security-login</artifactId>
|
||||||
@ -22,6 +21,11 @@
|
|||||||
<artifactId>spring-security-config</artifactId>
|
<artifactId>spring-security-config</artifactId>
|
||||||
<version>${org.springframework.security.version}</version>
|
<version>${org.springframework.security.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.security</groupId>
|
||||||
|
<artifactId>spring-security-taglibs</artifactId>
|
||||||
|
<version>${org.springframework.security.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- Spring -->
|
<!-- Spring -->
|
||||||
|
|
||||||
|
@ -1,9 +1,22 @@
|
|||||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||||
|
<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %>
|
||||||
<html>
|
<html>
|
||||||
<head></head>
|
<head></head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<h1>This is the body of the sample view</h1>
|
<h1>This is the body of the sample view</h1>
|
||||||
|
|
||||||
|
<security:authorize access="hasRole('ROLE_USER')">
|
||||||
|
This text is only visible to a user
|
||||||
|
<br/>
|
||||||
|
</security:authorize>
|
||||||
|
|
||||||
|
<security:authorize access="hasRole('ROLE_ADMIN')">
|
||||||
|
This text is only visible to an admin
|
||||||
|
<br/>
|
||||||
|
</security:authorize>
|
||||||
|
|
||||||
<a href="<c:url value="/perform_logout" />">Logout</a>
|
<a href="<c:url value="/perform_logout" />">Logout</a>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
Loading…
x
Reference in New Issue
Block a user