Subversion Repositories bacoAlunos

Rev

Rev 1390 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 fvelez 1
package pt.estgp.estgweb.web.tags;
2
 
1390 jmachado 3
import org.apache.struts.taglib.logic.ConditionalTagBase;
1814 jmachado 4
import pt.estgp.estgweb.utils.Globals;
1390 jmachado 5
import pt.estgp.estgweb.domain.UserSessionImpl;
1 fvelez 6
 
7
import javax.servlet.jsp.JspException;
8
 
1390 jmachado 9
public class IsNotAuthenticatedTag extends ConditionalTagBase
152 jmachado 10
{
1 fvelez 11
 
1390 jmachado 12
    protected boolean condition() throws JspException {
1 fvelez 13
        UserSessionImpl userSession = (UserSessionImpl) pageContext.getRequest().getAttribute(Globals.USER_SESSION_KEY);
1390 jmachado 14
        return !(userSession != null && userSession.getUser() != null);
152 jmachado 15
    }
16
 
1 fvelez 17
 
18
}