How to get parameters from the URL?
5/11/08 8:47 PM
Hi all,
Seems like a very simple thing to do, but I've been at it for a while now and just can't seem to get it to work! Here's my situation: I have created a new page and assigned a friendlyURL to it. On that page, I've placed several custom portlets (Struts-based) - all of this is taking place in it ext environment. All I would like to do is to be able to provide a parameter in the URL and retrieve that parameter in any of the portlets - how do I go about doing this? I've tried the obvious request.getParameter/request.getAttribute as well as various methods in the ParamUtil class, but it just doesn't seem to work. I must be missing something obvious here - any advice would be greatly appreciated! Thanks! |
|
RE: How to get parameters from the URL?
5/12/08 2:56 AM as a reply to Phil Mironenko.
Hi Phil,
i've had the same problems and i've used the following code: import com.liferay.portal.util.PortalUtil; HttpServletRequest httpReq = PortalUtil.getOriginalServletRequest(PortalUtil.getHttpServletRequest(req)); String myArticleId = httpReq.getParameter("articleId"); Note that this is a sort of hack that i've found, not an official solution. |