Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.sction.mvc.viewrender.freemarker;
 
 
 import java.util.Map;


Freemarker tag that renders the tag body only if the current user has not executed a successful authentication attempt during their current session.

The logically opposite tag of this one is the org.apache.shiro.web.tags.AuthenticatedTag.

Equivalent to org.apache.shiro.web.tags.NotAuthenticatedTag

public class NotAuthenticatedTag extends SecureTag {
    static final Logger log = Logger.getLogger("NotAuthenticatedTag");
    @Override
    public void render(Environment envMap paramsTemplateDirectiveBody bodythrows IOExceptionTemplateException {
        if (getSubject() == null || !getSubject().isAuthenticated()) {
            .debug("Subject does not exist or is not authenticated.  Tag body will be evaluated.");
            renderBody(envbody);
        } else {
            .debug("Subject exists and is authenticated.  Tag body will not be evaluated.");
        }
    }
New to GrepCode? Check out our FAQ X