Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Nauman Aslam
request parameter not copied to render parameters
June 30, 2011 5:15 AM
Answer

Nauman Aslam

Rank: New Member

Posts: 10

Join Date: June 28, 2011

Recent Posts

hi Evereyone ,
i want to copy request parameters of a user entered values to render parameter , i am doing the following in portlet.xml
<init-param>
<name>copy-request-parameters</name>
<value>true</value>
</init-param>
but it is not working for me, i tried to set for one parameter by using actionResponse.setRenderParameter("agencyname",actionRequest.getParameter("agencyname"));
which is available in JSP. but i have many parameter and want available in jsp by configuration to in portlet.xml
thanks in advance
Jay Patel
RE: request parameter not copied to render parameters
June 30, 2011 6:34 AM
Answer

Jay Patel

Rank: Regular Member

Posts: 119

Join Date: February 23, 2010

Recent Posts

Hi,

What is your use-case, if you explain in detail, may be I can help?

Regards,
Jay.

Nauman Aslam:
hi Evereyone ,
i want to copy request parameters of a user entered values to render parameter , i am doing the following in portlet.xml
<init-param>
<name>copy-request-parameters</name>
<value>true</value>
</init-param>
but it is not working for me, i tried to set for one parameter by using actionResponse.setRenderParameter("agencyname",actionRequest.getParameter("agencyname"));
which is available in JSP. but i have many parameter and want available in jsp by configuration to in portlet.xml
thanks in advance
Nauman Aslam
RE: request parameter not copied to render parameters
June 30, 2011 8:57 PM
Answer

Nauman Aslam

Rank: New Member

Posts: 10

Join Date: June 28, 2011

Recent Posts

Hi,
i have a form in portlet which is submitted by making action URL.i want in case of error, values entered by user should be there .
i have too many fields in form, that is why i dont want to manually copy the each parameter.
Nauman Aslam
RE: request parameter not copied to render parameters
July 4, 2011 12:11 AM
Answer

Nauman Aslam

Rank: New Member

Posts: 10

Join Date: June 28, 2011

Recent Posts

hello liferay team ,
please reply , i am waiting .

Regards
Muhammad Asif
RE: request parameter not copied to render parameters
July 21, 2011 6:30 AM
Answer

Muhammad Asif

Rank: Junior Member

Posts: 25

Join Date: April 11, 2011

Recent Posts

I want to fill up my form if there is an error in process action by the same values i posted.
Amos Fong
RE: request parameter not copied to render parameters
July 22, 2011 3:52 AM
Answer

Amos Fong

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1896

Join Date: October 7, 2008

Recent Posts

Does your portlet extend the MVCPortlet class? because that's where the copying is done:

 1    public void processAction(
 2            ActionRequest actionRequest, ActionResponse actionResponse)
 3        throws IOException, PortletException {
 4
 5        super.processAction(actionRequest, actionResponse);
 6
 7        if (copyRequestParameters) {
 8            PortalUtil.copyRequestParameters(actionRequest, actionResponse);
 9        }
10    }


Alternatively you can just use that PortalUtil method yourself.
Nauman Aslam
RE: request parameter not copied to render parameters
July 22, 2011 9:07 AM
Answer

Nauman Aslam

Rank: New Member

Posts: 10

Join Date: June 28, 2011

Recent Posts

thanks it worked for me, but my sir gave me another way to do it, by getting enumeration for action request
Enumeration<String> eStr = actionRequest.getParameterNames();
System.out.println("***Parameters Passed to this page");
while(eStr.hasMoreElements()){
String paramName = eStr.nextElement();
System.out.println("ParamName: " + paramName + ", ParamValue: " + actionRequest.getParameter(paramName));
actionResponse.setRenderParameter(paramName, actionRequest.getParameter(paramName));

}

Hoping it can be helpful
Roshan Qureshi
RE: request parameter not copied to render parameters
June 12, 2013 4:20 AM
Answer

Roshan Qureshi

Rank: Regular Member

Posts: 144

Join Date: August 24, 2010

Recent Posts

Hi Nauman,

The code you are using is right and the same code is being used by Liferay inside
PortalUtil.copyRequestParameters(actionRequest, actionResponse);

So better approach is just use above line in your portlet in processAction