[Building Sakai] Empty response after exception in RequestFilter
Daniel Merino
daniel.merino at unavarra.es
Fri Jan 24 01:43:01 PST 2014
Thanks, Steve, but it is not the case. I need RequestFilter to handle
uploads because I am adding methods to Resources classes. I just need to
take control over Response when this error happens.
I think that the better way will be fixing the issue in the client side,
not sending a request if an empty multipart is detected.
Thanks anyway!
Best regards.
El 22/01/14 00:18, Steve Swinsburg escribió:
> Hi Daniel,
>
> You might want to disable the RequestFilter from parsing file uploads
> This needs to be done for some frameworks that handle their own
> uploads (like Wicket) otherwise the RF eats them. In your web.xml RF
> declaration:
> <init-param>
> <param-name>upload.enabled</param-name>
> <param-value>false</param-value>
> </init-param>
>
>
> On Wed, Jan 22, 2014 at 12:34 AM, Daniel Merino
> <daniel.merino at unavarra.es <mailto:daniel.merino at unavarra.es>> wrote:
>
> Hi everybody.
>
> I am currently working to implement folder uploads through Drag &
> Drop.
> I have it working, but I am getting stuck in the little details.
>
> For example: if a folder is uploaded in a not valid browser,
> RequestFilter throws an exception:
>
> 2014-01-20 14:53:26,212 INFO http-bio-8081-exec-5
> org.sakaiproject.util.RequestFilter - Unexpected exception in
> upload parsing
> org.apache.commons.fileupload.FileUploadBase$IOFileUploadException:
> Processing of multipart/form-data request failed. Stream ended
> unexpectedly
> at
> org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:371)
> at
> org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:126)
> at
> org.sakaiproject.util.RequestFilter.handleFileUpload(RequestFilter.java:1089)
> at
> org.sakaiproject.util.RequestFilter.doFilter(RequestFilter.java:625)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
>
> and the response sent from server is empty, no matter if after the
> exception I use sendError or setStatus methods to overwrite it in
> ResourcesHelperAction class.
>
> I need to change the response to show a proper error message to users.
> Does anybody know if it is possible to modify the response code
> without
> touching RequestFilter?
>
> Thanks in advance.
> Best regards.
> --
> Daniel Merino Echeverría
> daniel.merino at unavarra.es <mailto:daniel.merino at unavarra.es>
> Gestor de teleformación - Centro Superior de Innovación Educativa.
> Tfno: 948-168489 - Universidad Pública de Navarra.
> _______________________________________________
> sakai-dev mailing list
> sakai-dev at collab.sakaiproject.org
> <mailto:sakai-dev at collab.sakaiproject.org>
> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>
> TO UNSUBSCRIBE: send email to
> sakai-dev-unsubscribe at collab.sakaiproject.org
> <mailto:sakai-dev-unsubscribe at collab.sakaiproject.org> with a
> subject of "unsubscribe"
>
>
--
Daniel Merino Echeverría
daniel.merino at unavarra.es
Gestor de teleformación - Centro Superior de Innovación Educativa.
Tfno: 948-168489 - Universidad Pública de Navarra.
--
La felicidad junta, la desgracia reune. (Anónimo)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20140124/460f5aac/attachment.html
More information about the sakai-dev
mailing list