0 Replies Latest reply on Jun 29, 2006 6:51 AM by alesj

    Wrong link in a portlet

    alesj

      Using Seam and JBP 2.4.

      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.

      Can something similar be the cause of my wrong link?
      - http://www.onjava.com/pub/a/onjava/2004/06/09/jsf.html?page=1

      Rgds, Ales