Topic
2 replies Latest Post - ‏2013-07-26T21:15:46Z by kevintap
saikiran
saikiran
20 Posts
ACCEPTED ANSWER

Pinned topic Reading query String parametes from Portal Url

‏2013-07-26T09:54:21Z |

Is there any way I can read the query String paramters from the URL. I have language switch action in the theme, I am passing additional parameters.

The Render Request url is coming like this

http://localhost:10039/wps/portal/hkclient/!ut/p/b1/hY1BDoIwFETPwgHM_9YisKygUgJocCF2Y7qQ0ggtMcSFp7cSt-LsJnlvBgTUIIx8aiVHbY3sPl2srz5bUkIoZuHOp8jLCivub1eHCB1wcQD-CMN_fjYBM747II8iLhSIQY7tQpvGQt3eO6u0gTOIaSDes5QGuVNoSJAnmzQJogKRB19g5qFMbX-Doa9feXM6KuZ5b2UhFe8!/dl4/d5/L0lDUmlTUSEhL3dHa0FKRnNBLzRKVXFDQSEhL3poX1RX/?switch=done

I have EventHandler onRequest builder, where I tried to read the above query paramter but not able to get the value. Pls help if there is any specific API i need to use to get the query string.

 

 

 

 

 

  • mburati
    mburati
    2544 Posts
    ACCEPTED ANSWER

    Re: Reading query String parametes from Portal Url

    ‏2013-07-26T15:02:39Z  in response to saikiran

    If an HTTP GET URL to a portlet makes it all the way to the portlet with the query param (as opposed to a portal URL which strips off its query params before asking portlets on the page to render themselves) then you can typically get at the params as inputs via webAppAccess.getRequestInputs().

    If you absolutely have to, you can use the webAppAccess.getHttpServletRequest() to get the request (actual servlet request when run standalone, and a servlet request wrapper, wrapping the portlet request when run as a portlet, so your code can remain the same) to use servlet request API methods to access additional info.

    If you need a Portlet Request method not usable via the servlet request API, then you can get access to the portlet request from the wrapped servlet request.    See the product documentation for information on how to do that:

    http://www-10.lotus.com/ldd/pfwiki.nsf/xpDocViewer.xsp?lookupName=Web+Experience+Factory+8+Documentation#action=openDocument&res_title=Access_to_portlet_APIs_from_a_model_wef8&content=pdcontent&sa=true

    I hope that info helps,
    ..Mike Burati 
    The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.
  • kevintap
    kevintap
    742 Posts
    ACCEPTED ANSWER

    Re: Reading query String parametes from Portal Url

    ‏2013-07-26T21:15:46Z  in response to saikiran

    The portlet spec does not allow reading query string parameters for a render request.  (A render request targets a portal page and may include rendering of multiple portlets.  The portlets are therefore not allowed to share information in this manner.)  Portlets may only access query string parameters during an action request.  (Action requests target a single portlet on a page and therefore the portlet spec allows access to the query string during the action phase.)  Can the link that you build in the portal theme set public render parameters?  If so, that would be a good way to get these parameters passed to your portlet.