0

I am referring to a url which has paramID from my portlet. The content of that paramID is handled in different portlet and it has its own controller.

That controller is taking HttpServletRequest to read that param.

HttpServletRequest request = PortalUtil.getOriginalServletRequest(PortalUtil.getHttpServletRequest(renderRequest));
String paramID= request.getParameter("paramID");`

My param is in the url http://mysite.com?paramID=123

Will the HttpServletRequest read this param when I am calling using renderURL

<liferay-portlet:renderURL var="xyz" portletName="ABC" windowState="Normal"/>
...
<a href="xyz?pramID"> Click here</a>
Dani
  • 3,744
  • 4
  • 27
  • 35
Some Java Guy
  • 4,992
  • 19
  • 71
  • 108

2 Answers2

0

Some information about render URL and such is under this question on its community wiki answer.

Also in some tutorial that is not on web I have read this kind of parameter passing is easiest done via session. Session is common for porlet and servlet so you don't have to think where the which parameter is visible and where not.

Community
  • 1
  • 1
mico
  • 12,730
  • 12
  • 59
  • 99
0

I did it with providing the param value while I invoked the renderURL

<liferay-portlet:renderURL var="xyz" portletName="ABC" windowState="Normal"/>
</liferay-portlet:renderURL>

.....

<JAVASCRIPT>
   var URL = NULL;       
   function(called){
          URL = "${xyz}&paramID=123"              //and this was read as servlet param
   }
</JAVASCRIPT>
Dani
  • 3,744
  • 4
  • 27
  • 35
Some Java Guy
  • 4,992
  • 19
  • 71
  • 108