I have a very strange problem, I have a useBean
loginCheck
which is stored in session and I want to use it to display a different menu according to the user logged. So here is my code in the JSP :
<jsp:useBean id="loginTest" type="java.lang.String" scope="session"/>
...
...
...
<ul id="menu">
<li><a href="<%=adresseIP.adressePage %>derogcontroller?lien=demandederog">Faire une demande de dérogations</a></li>
<li><a href="<%=adresseIP.adressePage %>derogcontroller?lien=listedemandes&demandeur=user">Voir mes demandes</a></li>
<%if(loginTest.equals("admin")){ %><li><a href="<%=adresseIP.adressePage %>derogcontroller?lien=utilisateur">Espace admin</a></li><%} %>
<%if(loginTest.equals("manager")){ %><li><a href="<%=adresseIP.adressePage %>derogcontroller?lien=utilisateur">Manager</a></li><%} %>
<%if(loginTest.equals("paie")){ %><li><a href="<%=adresseIP.adressePage %>derogcontroller?lien=utilisateur">Paie/Poste</a></li><%} %>
</ul>
When I run into this page the first time I have a page completely blank, no error, no logs, nothing. Then I run the page without the menu and the useBean
, so it works great, I can see the rest of the page. And then I put back my useBean
and my menu and here, it works, I can see the menu with the good link according to the user.
I'm very confused because my code works but only when I remove the code, access to the page, put back the code and refresh. Any idea about this problem ?