Blank window during the first access to the page

71 views Asked by At

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 ?

1

There are 1 answers

0
Roman C On

The part that is useBean is required, because without it the rest of the code doesn't work.

When you modify the code of JSP page you need to rebuild, redeploy this page or your application to make the changes effect.