Message Boards

Create a resourceURL with parameters from a HTML input form?

Thomas Kellerer, modified 3 Years ago.

Create a resourceURL with parameters from a HTML input form?

Expert Posts: 490 Join Date: 6/9/08 Recent Posts

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

thumbnail
Olaf Kock, modified 3 Years ago.

RE: Create a resourceURL with parameters from a HTML input form? (Answer)

Liferay Legend Posts: 6403 Join Date: 9/23/08 Recent Posts

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.

Thomas Kellerer, modified 3 Years ago.

RE: RE: Create a resourceURL with parameters from a HTML input form?

Expert Posts: 490 Join Date: 6/9/08 Recent Posts

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.