2 Replies Latest reply on Jun 28, 2006 11:02 AM by Gavin King

    Wrong link in a portlet

    Ales Justin Master

      I have 2 portlets on my page.
      One of them is a login portlet.
      After login I display the following logout jsp in this login portlet:

      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
      <f:view>
       <h:form>
       Hello <h:outputText value="#{currentUser.username}"/>!
       <p/>
       <h:commandLink action="#{logout.logout}" value="Logout"/>
       </h:form>
      </f:view>
      
      
      @Stateless
      @LoggedIn
      @Name("logout")
      public class LogoutAction implements Logout {
      
       @In
       Context sessionContext;
      
       public String logout() {
       Seam.invalidateSession();
       sessionContext.set(USER_VAR, null);
       sessionContext.set(LOGGED_IN, null);
       return "login";
       }
      
      }
      
      


      Then I use another portlet - input some params and submiting them.

      The problem is that then my logout link is pointing to the wrong url - so the first time I hit this link it doesn't do anything. The page is rerendered, but then the logout link is the right one - clicking it really hits my LogoutAction SLSB.

      Rgds, Ales