Fórum
request parameter not copied to render parameters
Nauman Aslam, modificado 12 Anos atrás.
request parameter not copied to render parameters
New Member Postagens: 10 Data de Entrada: 28/06/11 Postagens Recentes
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
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, modificado 12 Anos atrás.
RE: request parameter not copied to render parameters
Regular Member Postagens: 118 Data de Entrada: 24/02/10 Postagens Recentes
Hi,
What is your use-case, if you explain in detail, may be I can help?
Regards,
Jay.
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, modificado 12 Anos atrás.
RE: request parameter not copied to render parameters
New Member Postagens: 10 Data de Entrada: 28/06/11 Postagens Recentes
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.
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, modificado 12 Anos atrás.
RE: request parameter not copied to render parameters
New Member Postagens: 10 Data de Entrada: 28/06/11 Postagens Recentes
hello liferay team ,
please reply , i am waiting .
Regards
please reply , i am waiting .
Regards
Muhammad Asif, modificado 12 Anos atrás.
RE: request parameter not copied to render parameters
Junior Member Postagens: 25 Data de Entrada: 11/04/11 Postagens Recentes
I want to fill up my form if there is an error in process action by the same values i posted.
Amos Fong, modificado 12 Anos atrás.
RE: request parameter not copied to render parameters (Resposta)
Liferay Legend Postagens: 2047 Data de Entrada: 07/10/08 Postagens Recentes
Does your portlet extend the MVCPortlet class? because that's where the copying is done:
Alternatively you can just use that PortalUtil method yourself.
public void processAction(
ActionRequest actionRequest, ActionResponse actionResponse)
throws IOException, PortletException {
super.processAction(actionRequest, actionResponse);
if (copyRequestParameters) {
PortalUtil.copyRequestParameters(actionRequest, actionResponse);
}
}
Alternatively you can just use that PortalUtil method yourself.
Nauman Aslam, modificado 12 Anos atrás.
RE: request parameter not copied to render parameters
New Member Postagens: 10 Data de Entrada: 28/06/11 Postagens Recentes
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
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, modificado 10 Anos atrás.
RE: request parameter not copied to render parameters
Regular Member Postagens: 159 Data de Entrada: 24/08/10 Postagens Recentes
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
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