Forums de discussion

portal_normal.vm request parameter values coming as blank or empty

thumbnail
Baladhandapani Nagarajan, modifié il y a 9 années.

portal_normal.vm request parameter values coming as blank or empty

Junior Member Publications: 26 Date d'inscription: 12/01/15 Publications récentes
Hi All,

Just want to give a quick background about the issue :

We are in the process of migrating from 6.1 to 6.2 , we have embedded port-let as part of themes to display the header and footer content (content comes from the documentum server). We are passing the 'contentName' as a request parameter from the portal_normal.vm file and reading it in the Controller class (getting the content from the Documentum based on the content name and displaying it within the Embedded portlet in headers / footers section).

After We migrated from 6.1 to 6.2 , for some of the pages the 'contentName' value is coming as null/blank (even though We have specified the valid 'contentName' values in the portal_normal.vm file associated with the applied theme) .

If I create a new blank page and apply the same theme , Iam able to read the request parameter (contentName) specified in the portal_normal.vm file . The problem occurs for the existing pages (created before 6.2 migration) I have already checked the uniqueness of each portletId instance in the page (specified as unique values)

Can someone please provide your inputs to proceed further ? -
thumbnail
Olaf Kock, modifié il y a 9 années.

RE: portal_normal.vm request parameter values coming as blank or empty

Liferay Legend Publications: 6400 Date d'inscription: 23/09/08 Publications récentes
Can you please post some code? So far what I get is "I've done something, but it doesn't work"
thumbnail
Baladhandapani Nagarajan, modifié il y a 9 années.

RE: portal_normal.vm request parameter values coming as blank or empty

Junior Member Publications: 26 Date d'inscription: 12/01/15 Publications récentes
Sorry my bad

please check my code -

Entry in the portal_normal.vm file (from velocity template file , we are passing the 'contentName' as parameter)

$theme.runtime("embeddedWebContent_WAR_wp_INSTANCE_ftr1", "contentName=footerLinksStudentSupportUc", "")

In my Controller class

Iam trying to read it from the request

String contentName = request.getParameter("contentName");

The value is coming as null for the existing pages (which was working fine with 6.1 earlier) . If I create a new page and apply the same theme (In 6.2) , Iam getting the "contentName" from request (working fine). This is happening for couple of themes ..

Even I tried with , no luck request parameter coming as null.

HttpServletRequest httpReq = PortalUtil.getHttpServletRequest(request);
HttpServletRequest httpReq = PortalUtil.getOriginalServletRequest(PortalUtil.getHttpServletRequest(request));
thumbnail
Baladhandapani Nagarajan, modifié il y a 9 années.

RE: portal_normal.vm request parameter values coming as blank or empty

Junior Member Publications: 26 Date d'inscription: 12/01/15 Publications récentes
Can some one please help me here , it looks like this is more specific to 6.2 .

I tried setting the parameter variable separately and passed as part of the query String in "$theme.runtime). In all the scenarios the parameter value (contentName) comes as null or empty in the Controller class for the existing pages.
thumbnail
Baladhandapani Nagarajan, modifié il y a 9 années.

RE: portal_normal.vm request parameter values coming as blank or empty

Junior Member Publications: 26 Date d'inscription: 12/01/15 Publications récentes
Hi All,

Let me rephrase my problem :

1. We are constructing the Query string (the query string has the content name) and passing the constructed Query String as a parameter

$theme.runtime("embeddedWebContent_WAR_wp_INSTANCE_ftr41", "contentName=abc", "")

2 We have embedded the Query String as part of the theme in Portal_normal.vml file (velocity template file) . In our application ,we are forwarding to the route portlet where the constructed query string is 'Null' / 'Empty' .

In the Controller class , Iam trying to get the 'contentName' from the request , its getting blank or empty.

String contentName = request.getParameter("contentName");

'contentName' is blank or empty.

I really appreciate your inputs.
thumbnail
Olaf Kock, modifié il y a 9 années.

RE: portal_normal.vm request parameter values coming as blank or empty

Liferay Legend Publications: 6400 Date d'inscription: 23/09/08 Publications récentes
You might want to try two alternative approaches: One is to Go through the ""portal preferences" parameter instead of the "querystring". The other one is to namespace the parameters that you expect to see in the portlet. Let us know if this works
thumbnail
Baladhandapani Nagarajan, modifié il y a 9 années.

RE: portal_normal.vm request parameter values coming as blank or empty

Junior Member Publications: 26 Date d'inscription: 12/01/15 Publications récentes
Thank you Olaf ! Its working now. I have done the following changes and its working now.

1. I cleared the database cache for the base portal instance
2. I tried the portal preferences - its working now. After I cleared the database cache , now Iam getting the content name value in portletrequest/httprequest & preferences.