Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
Bob Dietrich
Link to customized page for guests
May 12, 2011 9:34 AM

Bob Dietrich

Rank: Regular Member

Posts: 221

Join Date: May 15, 2005

Recent Posts

Maybe this isn't as complicated as I expect, but here's what I want to do.

I need to create a customized page for people without an account. The page will contain a portlet I've written and display information unique for that visitor. I'm assuming the portlet can receive parameters via the URL used to take the visitor to that page.

A couple of questions:
  1. I'm assuming I can simply create a public page on the system and add my portlet to that page. Correct?
  2. To construct the URL to take visitors to the page, I need to construct it programmatically using a technique similar to here. The link may be sent to the user rather than clicked on. Does this sound correct?
Corné Aussems
RE: Link to customized page for guests
May 15, 2011 1:19 PM

Corné Aussems

Rank: Liferay Legend

Posts: 1314

Join Date: October 3, 2006

Recent Posts

Techniques for getting parameter in

Nrmally your portlet does not have access to this parameter! This is because, by default, the requests passed to your portlets are namespaced and portlets only have access to their namespaced parameters.
You can still grab them easily though if you want to by doing this:

In a JSP:
String param = PortalUtil.getOriginalServletRequest(request).getParameter("param");
In a portlet render:
HttpServletRequest request = PortalUtil.getHttpServletRequest(renderRequest);
String param = PortalUtil.getOriginalServletRequest(request).getParameter("param");