3 Replies Latest reply on Sep 12, 2006 11:42 AM by tajh

    response.createRenderUrl() always returns

      My environment:
      JBoss Portal 2.2.1 SP3, downloaded
      JBoss AS 4.0.4
      Oracle 10g
      Windows XP SP2
      jdk 1.5.0_07

      I am attempting to construct a URL within a portlet for output that returns to the same portal page, but with an additional parameter added.

      For some reason, within my portlet's doView(request, response) method, whenever I call response.createRenderUrl(), I always get a URL like the following:

      /portal/index.html?ctrl:cmd=render&ctrl:window=marad.default.Feedback


      where the relative path portion of the url is not what I expect. The actual URL for the page request that generates this behavior is:

      http://localhost:8080/portal/portal/marad/


      as I have not yet configured my portal app to be the default portal app. So
      I am expecting the url to look similar, so that the URL generated would look something like the following:

      /portal/portal/marad/default?<i>param1=value1&param2=value2&...</i>


      What is the proper way to construct a URL that returns to the same portal page, albeit with some attached parameters? Is it possible to do this without proprietary casting of the request and response to JBossRenderRequest and JBossRenderReponse? Even the following code inside my portlet:
      JBossRenderRequest jbossRequest = (JBossRenderRequest)request;
      JBossRenderResponse jbossResponse = (JBossRenderResponse)response;
      PortalNodeURL pnUrl = jbossResponse.createRenderURL(jbossRequest.getPortalNode());

      produced null for pnUrl. help!



        • 1. Re: response.createRenderUrl() always returns
          antoine_h

          to manage your own mapping between url and page/window, and manage the parameter your way, you should write your own url mapping service.

          You can look at the CMSPortlet object that works with it's own mapping for url like ...portal/content/myFile.html and rely on the CMS repository to get the file.

          see the doc, about the CMS and the prefix of the url for files in the cms repository. there is an explaination about this... and that is a good start.

          then look at services like :
          portal:urlFactory=CMSObject
          and
          "portal:commandFactory*"
          or portal:commandFactory=CMSObject
          (these are defined in a jboss-service.xml file, in meta-inf folder)

          and classes such as CMSObjectURLFactory and CMSObjectCommandFactory

          portal 2.4 has been enhanced for managing this : for what I have just seen, you should be able to manage several prefixes, with several window target.

          • 2. Re: response.createRenderUrl() always returns

            I think either you misunderstand what it is I need, or else I misunderstand the complexity of this task.

            All I want is to construct a URL that points to the existing web page, from within a portlet, which is already mapped by JBoss Portal to execute the portlets, etc. I do not need any custom URL mappings to create special behavior when that URL is accessed.

            • 3. Re: response.createRenderUrl() always returns

              Followup: the issue was using the url in a form, with GET method. Found out form needs to be sent with POST method, and the url needs to be an action URL, not a render url.