Forums

Home » Liferay Portal » English » Liferay Legacy »

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
David Andreasson
Access a page request parameter in a struts portlet
August 16, 2007 2:51 AM
Answer

David Andreasson

Rank: New Member

Posts: 6

Join Date: August 16, 2007

Recent Posts

In my portal I have a page containing a number of portlets and in one of them I need to access a parameter passed in the url to the page, like so: http://myurl?myparam=value

My problem is, since the parameter is passed in the url to the page, rather than to the url to the portlet, I don't seem to have access to it.

Is there a setting somewhere that has to be set for the parameters to be accessible from the portlets or is there something else I'm missing?
David Andreasson
RE: Access a page request parameter in a struts portlet
August 20, 2007 6:19 AM
Answer

David Andreasson

Rank: New Member

Posts: 6

Join Date: August 16, 2007

Recent Posts

Solved.

(As suspected) I just needed to get the correct url of the portlet (from within the portlet) using:

PortletURL portletURL = renderResponse.createRenderURL();
Daniel Bleisteiner
RE: Access a page request parameter in a struts portlet
June 25, 2008 6:59 AM
Answer

Daniel Bleisteiner

Rank: New Member

Posts: 16

Join Date: June 17, 2008

Recent Posts

Could you make this a little more clearer?

I'm also trying to access a URL request parameter like "query" and had no success yet. Also trying a namespace prefix didn't work... and is far to complex for a simple query string I want to use.

By debugging the request I've found a _req property of Type NamespaceServletRequest with a property _inherit... as soon as I set this to true using the debugger I get my parameter... but there is no way to handle this programmatically as far as I see...