Foros de discusión

Managed Pages > Advanced > Query String not working?

thumbnail
Andew Jardine, modificado hace 10 años.

Managed Pages > Advanced > Query String not working?

Liferay Legend Mensajes: 2416 Fecha de incorporación: 22/12/10 Mensajes recientes
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=[name]

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:


HttpServletRequest request = PortalUtil.getOriginalServletRequest(PortalUtil.getHttpServletRequest(renderRequest));
String 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
thumbnail
Jignesh Vachhani, modificado hace 10 años.

RE: Managed Pages > Advanced > Query String not working?

Liferay Master Mensajes: 803 Fecha de incorporación: 10/03/08 Mensajes recientes
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.
thumbnail
Andew Jardine, modificado hace 10 años.

RE: Managed Pages > Advanced > Query String not working?

Liferay Legend Mensajes: 2416 Fecha de incorporación: 22/12/10 Mensajes recientes
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.