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
RE: RE: Create a resourceURL with parameters from a HTML input form?
I would like to provide parameters to a resourceURL through an HTML input form in my JSP page.
Background: the resourceAction will generate an output file, but the generation can be parameterized through values in the HTML input form.
Is a resourceURL the right choice for this? Or should I use an actionURL - but so far I only found examples for providing a download through resourceURLs not through actionURLs. However it seems I can't use an ActionResponse with PortletResponseUtil.sendFile()
Thanks
If you want the output file to be served to the client as a result of the form submission, resourceURL is your friend. A portlet action always results in a rendering of the full page, never in any arbitrary file being served. A resource activity always gives you full control over the result, its Mime type, etc.
Thanks.
After I realized that the resourceURL will still post the whole form content I was able to get this to work with a resourceURL.
Powered by Liferay™