Hi,

In short:
We are trying to do our own type of processing for Multi-part HTTP POST streams 
and are sort of stuck with one of those beautiful "final" methods wicket 
framework has in so many places.

More specifically:
We'd like to use Wicket Form for file uploads (with Ajax progress etc.). We 
have a working prototype using standard Wicket forms with file upload 
functionality. However, we have a pretty complex logic as far as dealing with 
Multi-part HTTP POST streams, which we need to port from existing non-Wicket 
application (stream mirroring on the fly, etc.). So we need to get access to 
the raw streams rather than simply receive the files on the file system. So, 
can we get the access in Wicket to the raw HTTP POST stream (like we can in the 
current non-Wicket application, using HttpServletRequest.getInputStream() 
method in doPut of a [tomcat] servlet) ?

>From looking into wicket framework code, it looks like the simplest way is to 
>substitute the MultipartServletWebRequest (which - just like the 
>IMultipartWebRequest interface - insists that the "multipart streams" can only 
>be dealt with as a "collection of files") with our own one. It appears that we 
>could simply override the Form's handleMultiPart() method in our custom Form 
>subclass and substitute these very simple lines in Form class with our own 
>logic:

if (multiPart) {
    final WebRequest multipartWebRequest = 
((WebRequest)getRequest()).newMultipartWebRequest(this.maxSize);
    getRequestCycle().setRequest(multipartWebRequest);
}

Actually, considering Form's onFormSubmitted() method is declared "public final 
void", overriding handleMultiPart() method seems like not only the best but 
also the only alternative. But, then, handleMultiPart() is declared "private 
final boolean" as well... Bummer!

Tried reading/searching whatever I could, but didn't find any viable 
alternative either. I couldn't see how hacking the raw HttpServletRequest 
described at
    http://cwiki.apache.org/WICKET/raw-httpservletrequest.html
could help us either, or at least it's unclear at what point we could do that, 
considering that "final" method problem described above. Someone at ##Wicket 
IRC chat suggested we should write to the mailing list, so here I am...

Anybody here knows if wicket can be extended to process Multi-part HTTP POST 
streams in a custom way? And, if not, may be the respected members of the 
wicket team could consider simply making that method
    private final boolean handleMultiPart()
"protected" and not "private final" in the next version...

For the time being (and, unless we hear otherwise), we'll simply modify 
Form.class in Wicket 1.2.4 .jar with the version that uses "protected" modifier 
instead of "private final" one, and will hope that in the next version that 
change becomes part of Wicket API.

Thank you very much in advance for your consideration,
Boris.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to