While switching to admin panel, I set request attribute to show back button:
public void adminPanel() {
Tools.getRequestContext().setAttribute("show_back_button", true);
}
Now in JSP page I check if this attribute exists:
<c:if test="${show_back_button eq true}">
<h:commandButton action="index?faces-redirect=true"
immediate="true"
type="submit"
value="#{msg.back}"
styleClass="btn btn-default admin-button" />
</c:if>
After first entering admin panel, I have visible Back button. But when clicked, redirection to index.xhtml wasn't fired, but admin.xhtml is refreshing.
When I comment and everything is working fine and, back button is always visible, but is working.
So my question is what happens if show_back_button
attribute is not set and I will test it with EL? JSF phases are corrupted? Maybe something else? What am I doing wrong?