Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <sec:authorize ifAnyGranted="ROLE_ANONYMOUS">
- <td><a href="<c:url value="/login.htm"/>">Login</a></td>
- </sec:authorize>
- <sec:authorize ifNotGranted="ROLE_ANONYMOUS">
- <td><a href="<c:url value="/j_spring_security_logout"/>">Logout</a></td>
- </sec:authorize>
- <sec:authorize access="isAnonymous()">
- <form method="POST" action="<c:url value='j_spring_security_check'/>">
- Username: <input name="j_username" type="text" value="${SPRING_SECURITY_LAST_USERNAME}" />
- Password: <input name="j_password" type="password" />
- <input type="submit" value="Sign in" />
- </form>
- </sec:authorize>
- <sec:authorize access="isAuthenticated()">
- <a href="<c:url value="/j_spring_security_logout" />">Logout</a>
- </sec:authorize>
- <sec:authorize var="loggedIn" access="isAuthenticated()" />
- <c:choose>
- <c:when test="${loggedIn}">
- You are loged in
- </c:when>
- <c:otherwise>
- You are logged out
- </c:otherwise>
- </c:choose>
- <%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
- <sec:authorize access="isAuthenticated()">
- YES, you are logged in!
- </sec:authorize>
- <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
- <%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %>
- <security:authorize ifAllGranted="ROLE_USER">
- Welcome <%= request.getUserPrincipal().getName() %>
- <a href="<c:url value="/j_spring_security_logout"/>">Logout</a><br/>
- </security:authorize>
- <%@ taglib uri="http://acegisecurity.org/authz" prefix="authz" %>
- <c:set var="authenticated" value="${false}"/>
- <authz:authorize ifAllGranted="ROLE_USER">
- <c:set var="authenticated" value="${true}"/>
- </authz:authorize>
- <c:if test="${authenticated}">
- <!-- your secure content here -->
- </c:if>
- <%
- if (request.getRemoteUser()== null) {%>
- <!-- put public-only information-->
- <%}%>
- <%@ page import="org.springframework.security.context.SecurityContextHolder" %>
- <c:if test="<%=SecurityContextHolder.getContext().getAuthentication() != null %>">
- <!-- your secure content here -->
- </c:if>
Add Comment
Please, Sign In to add comment