I've got a need to show an Upload progress bar in a Wicket app that I've built. We're uploading some fairly large files and would like to see some statuses. Figured out with Igor how to go about injecting a CountingInputStream into the process for FileUpload, but have run into a roadblock!

What ends up happening, is the page runs a javascript, to show another page that meta refreshes and shows a status grabbed from the session. And at the same time submits the form to start the upload. Only problem is, it seems to block on the form submission uploading the file, and never shows the status page until after its done processing the form. Obviously too late.

Igor mentioned that this was probably because Wicket synchronizes with the session. And we both think there must be a way around this that is missing.

the code I have overrides:

protected WebRequest newWebRequest(HttpServletRequest servletRequest)

and then subclasses ServletWebRequest offering a wrapped MultipartServletWebRequest which passes back a custom FileItem that wraps the InputStream in a CountingInputStream, that in turn updates the Session. Whew! That was long.

Ideas and thoughts?

Thanks!



-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to