• 2 replies
  • Latest Post - ‏2013-07-26T21:15:46Z by kevintap
20 Posts

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


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
    2591 Posts

    Re: Reading query String parametes from Portal Url


    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:

    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
    756 Posts

    Re: Reading query String parametes from Portal Url


    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.