Fórumok

Link to customized page for guests

fastbob fastbob, módosítva 13 év-val korábban

Link to customized page for guests

Regular Member Bejegyzések: 221 Csatlakozás dátuma: 2005.05.16. Legújabb bejegyzések
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:
  • I'm assuming I can simply create a public page on the system and add my portlet to that page. Correct?
  • 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?
Thanks.
thumbnail
Corné Aussems, módosítva 12 év-val korábban

RE: Link to customized page for guests

Liferay Legend Bejegyzések: 1313 Csatlakozás dátuma: 2006.10.03. Legújabb bejegyzések
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");