0 Replies Latest reply on Jan 26, 2006 9:26 AM by tschmidt2

    Problem with createActionURL (JBossRenderResponse)

    tschmidt2

      Hello.

      In order to create logout links at desired positions outside the user portlet, I've done the following:


      PortalNodeURL login;
      JBossPortalNode child;
      // ...search for portlet window with user portlet
      login = resp.createActionURL(child);
      login.setParameter("op", "userLogout");


      unfortunately this does not work. The setParameter line throws a NullPointerException due to the fact that login is still null when setting a parameter.

      However, I've found a workaround. I created this link with a RenderURL instead and compared to the "real" link of the user portlet. Basically the same URL is generated, the only difference is that cmd is set to "render" instead of "action". So I replace the string and the logout works correctly.


      PortalNodeURL login;
      JBossPortalNode child;
      // ...search for portlet window with user portlet
      login = resp.createRenderURL(child);
      login.setParameter("op", "userLogout");
      // replace "render" with "action" in login string


      I must confess this is kind of confusing for me (I'm happy that it works at all :D). Can anyone tell me what went wrong here?

      Greetings Thorsten