I'm using Struts2
to build a web application. I have a method in a class called BaseAction
, where all other Actions extend it, as written below:
public boolean isUserFullyLogged() {
final Boolean isLogado = (Boolean) this.retrieveSessionAttribute(Constantes.LOGADO);
return (isLogado != null) && isLogado.booleanValue();
}
I want to access this method in my JSP to show or not certain content and have tried the syntax below for this:
-
<s:if test="#userFullyLogged">Conteúdo</s:if>
-
<s:if test="%{#userFullyLogged}">Conteúdo</s:if>
-
<s:if test="userFullyLogged">Conteúdo</s:if>
-
<s:if test="%{userFullyLogged}">Conteúdo</s:if>
But none of them worked and the method just is not called. Does anyone know where I am wrong and what is the correct syntax for calling a method in the backend?