0 Replies Latest reply on May 7, 2006 2:30 PM by Colin Toal

    PortletRequestImpl question

    Colin Toal Newbie

      Hi all,

      I'm working with Portal 2.4, Seam, MyFaces, Facelets, JBoss4.0.4 and mySql 5.0.

      I'm trying to build some JSF components that are specific to JSF usage in portlets (like the Portlet Tag Library, but for JSF). The simplest example is a version of HtmlOutputLink that will render a link that is relative to the portal that the portlet is part of.

      My first question is: Is this the right approach or am I misunderstanding something about HtmlOutputLink that makes it not use Portal Container relative links ?

      Secondly, I'm having some trouble in getting the Portal Request URL, and I think it comes down to a decision about the specification - as indicated by the comments in org.jboss.portal.portlet.impl.jsr168.PortletRequestImpl's getContextPath() method, as follows:

       // PLT.11.1.5
       public String getContextPath()
       // Fixme : should use the incoming request ?
       return invocation.getContainer().getWebApp().getContextPath();
       // PLT.11.1.6

      I would be able to use this getContextPath() method in my subclass of HtmlOutputLink in order to form URLs relative to the Portal Container if it returned the URL Portal Container Contextpath (which it does for all portlets deployed in the Portal Container Application).

      Unfortunately, what I get from this method now is the ContextPath of the web application that my portlet is deployed in. This is considerably less useful to me than that portal container path as I think I get this path from ExternalContext.getRequestContextPath or from other means anyway.

      My question for the group is this : Is the spec ambiguous and so this is really a problem with the specification, or should the PortalRequest interface return properties that are relative to the Portal Container - making this a bug ?

      I will work around it in the meantime, but I'd like to know if it is something that should be fixed.