You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Prasad Kashyap <vp...@us.ibm.com> on 2001/02/01 00:07:02 UTC

RE: Help: DiskMultipartRequestHandler

Hi Mike,

Thanx for your reply.

I think there is a bug in the upload package. The file is getting uploaded
into the specified directory  (tempDir parameter) but is not getting
renamed to the original name. It remains as strtsxxxx.tmp.  The data inside
is valid and so is the file size.

I am forced to use struts 0.5. Hence I pulled back the upload package into
struts 0.5. I instantiated DiskMultipartRequestHandler and called it's
handleRequest().

Or am I doing something wrong ?

Any help would be greatly appreciated.

Thanx
Prasad.

"Schachter, Michael" <MS...@Bluestone.com> on 01/31/2001 11:23:36 AM

Please respond to struts-user@jakarta.apache.org

To:   "'struts-user@jakarta.apache.org'" <st...@jakarta.apache.org>
cc:
Subject:  RE: Help: DiskMultipartRequestHandler




>Where in the ActionServlet is the DiskMultipartRequestHandler class
>instantiated ?

DiskMultipartRequestHandler (or whatever implementation is used) is created
inside of RequestUtils.populate(Object,String,String,HttpServletRequest).
The RequestUtils.populate method is called from
ActionServlet.processPopulate()


>What makes the handleRequest() to be called as the first method
>automatically ? Who calls it ?

handleRequest(HttpServletRequest request) is an interface method in
MultipartRequestHandler that is specified to be called on to handle
multipart requests.  "Handling" multipart requests consists of doing
whatever the implementation wants it to do.  The
DiskMultipartRequestHandler
reads the ServletInputStream and obtains form input entries and file input
entries.  It's called inside of RequestUtils.populate() soon after the
MultipartRequestHandler class is instantiated.