Redirecting back to portlet from ResourceMapping in Spring 3 portlets

I am trying to develop a way to provide CSV downloads through the Spring 3 port. I have a method that uses annotation @ResourceMappingto define a handler that takes some report parameters on the form @ModelAttribute, builds the report and returns it. Trap-22, on which I run, checks the parameters sent from the client form.

If I make a handler a @ResourceMapping, I can set the headers and write the report using ResourceResponse, but I can’t figure out how to redirect the user back to the Portlet view with an error when their input has failed the validation. However, if I do this @ActionMapping, I can check BindingResultand send them back to the form as necessary, but it ActionResponsedoes not allow me to set the Content-Disposition header and not write out the CSV, which is critical for sending a report.

I have a complete loss here, because I don’t even know what options I have. Is it possible to do what I'm trying to do with a portlet? Are there any other examples that I could pay attention to possible work?

+1
source share
1

@ActionMapping, @ResourceMapping .

, validation @ActionResponse, , Resource Streaming.

, @ActionResponse @RenderResponse, , iframe , src ResourceURL.

Request, @ResourceMapping, Validated. , CSV.

, UI, jsp views . , validation @ResourceMapping.

0

All Articles