Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
How to get Content-Disposition: form-data parameter values in render?
Hello Team,
My requirement is like There is one third party web service which requires return url from application server side on which it will redirect with some parameters and I want to fetch that parameter values in render
While inspecting request payload in Network i am getting msg form-data parameter like this:
Content-Disposition: form-data; name="msg"
123654054
I want to fetch the value of this parameter in render. I have tried
fetching value using HttpServletRequest
like:
HttpServletRequest originalRequest = PortalUtil.getOriginalServletRequest(PortalUtil.getHttpServletRequest(request));
String msg = originalRequest.getParameter("msg");
But i am getting msg value as null
Can anybody say what am i doing wrong?
Regards,
Ronak Parekh
Sounds like you have a multipart form, so the original servlet request doesn't have any of those parameters (they are inside of the multipart form body, and so they aren't generally treated as request parameters). Have you already tried PortalUtil.getUploadServletRequest to get their values?
Hi Minhchau,
Thanks for reply.
I have tried following code in render as it is multipart form :
UploadServletRequest uploadServletRequest = PortalUtil.getUploadServletRequest(PortalUtil.getHttpServletRequest(request));
String msg= uploadServletRequest.getParameter("msg");
But I am getting null value for msg.
Ronak Parekh:I have tried following code in render as it is multipart form :
Is the original form URL a render URL, or is it an action URL? If it's an action URL, none of the multipart form parameters will be available in the render phase unless you explicitly set them with ActionResponse.setRenderParameter.
I can see parameter with value in request payload in Network like this:
Content-Disposition: form-data; name="msg"
312
How can I get this value in render?
Powered by Liferay™