Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Andrew Jardine
Managed Pages > Advanced > Query String not working?
December 1, 2013 9:32 AM
Answer

Andrew Jardine

Community Moderator

Rank: Liferay Legend

Posts: 1062

Join Date: December 22, 2010

Recent Posts

Hey Guys,

I'm stuck on this one. I have tried several suggestions (all fairly similar to be honest) but none of it is working for me. Here is what I have.

1. Top level Parent navigation item (Recipe) -- type is Portlet. On this page I have a few portlets that communicate with each other using IPC
2. I then have several child pages -- all with type "Link to Page" with the Recipe page selected.
3. For each of them I have gone to the advanced tab and entered a query string category=

My assumption here is that at this stage the query string is appended to the original http request when one of the child pages is selected.

4. In one of my portlets, the one that cares about the url parameter I use this code to try to pull it down:

1
2HttpServletRequest request = PortalUtil.getOriginalServletRequest(PortalUtil.getHttpServletRequest(renderRequest));
3String category = request.getParameter("category");


but so far all I have received in null. Debugging the code and looking at the query string, I don't see my value being appended. Any ideas would really be appreciated.

Liferay 6.1.2 GA3 CE
Jignesh Vachhani
RE: Managed Pages > Advanced > Query String not working?
December 2, 2013 3:15 AM
Answer

Jignesh Vachhani

Rank: Liferay Master

Posts: 785

Join Date: March 10, 2008

Recent Posts

Hi Andrew,

It seems like Liferay query parameter functionality is not working properly if its not adding any query parameter at the end of URL.
Also the code which you used is correct to read query parameter but it will work only when you will have some parameter in URL.
Try to pass query parameter manually and check whether its working or not and if it works then you can pass query parameter by other way like using javascript and all.
Andrew Jardine
RE: Managed Pages > Advanced > Query String not working?
December 9, 2013 6:43 PM
Answer

Andrew Jardine

Community Moderator

Rank: Liferay Legend

Posts: 1062

Join Date: December 22, 2010

Recent Posts

Hi Jignesh,

In the end I found that it was not working with the MVCPortlet. I decided to try using the URL type in place of the Link to Page -- and appended my value to the end of the URL rather than using the Advaced > Query String option. That works and I am able to grab the value using the code I referenced in the original post.