On Fri, 2003-09-19 at 15:34, Stephen Davidson wrote:
Hi Santanu. I just ran both your file-upload, file-upload-example, and one of my models, with extra debugging information thrown in. The uploaded files are not currently available in the Request Object as ANYTHING. There is no parameter or attribute that has the file data. This is the issue that I am referring to.
Well I get the file data in the ModelRequest object in my model using Branch 1.0. The ModelAction class sets it. Remember the fileupload process is based on org.apache.struts.upload.FormFile object in struts which is the one taht comes in thru the HTTPRequest object.Looks like there are some issues with way the parameters are passed in the CVS HEAD version of clnt-struts.
I have added extensive debugging code to ModelUpload, as well as placed XDoclet tags (and a few other things) into my version of it. Due to missing file parameters/attributes in the request object, I can't verify that the code is actually working. I know that it is not working with HEAD version of Keel, as it is not finding the file parameters in the request object. This is why I have not checked in what I have so far. If you want, I can email/ftp/whatever what I have to you. As for the questions I have, the only one outstanding at the moment is in regards to Struts Client's ModelAction.execute. It diverged quite remarkably in 1.0 & HEAD, and as a result, I have not yet been able to determine how to effectively merge the two versions.
Agreed. clnt-struts in HEAD is totally different and better from the one we have for Branch 1.0.
What I have been able to determine from the FileUploadModel failure is what block of code in ModelAction.execute v1.0 is reading in the file, and loading it as a parameter into the Model. I have also determined that for the application I am doing, there may be a problem. It will be routine for what I am working on to be receiving/sending Multi-Gigabyte sized files (specs are: min file size = 50MB, normal file size = .5GB - 2GB, max file size = 8GB). Storing something of this in memory may not be a good idea (or would the OS Virtual Memory Manager use page swapping and allow this?)
The default filesize allowed is 4MB max. If you want something else you have to pass the "max_file_size_filter" parameter in the request or set it in the configuration file. Remember the one that you pass in the request over writes the one you may have in the configuration file.
As Mike pointed out, the COMMAND and PARAM parameters are for the Command object which builds the button for html form submission in the server side. It is pretty handy to pass in parameters as hidden fields with the button clicked. We have this design from Expresso days and works like a charm. But your way of embedding it in the ACTION will also work and is also a good idea too.In regards to passing parameters via button clicks, yes, quite readily. You can start with; <INPUT TYPE="hidden" name"parameter name" value="value"> So long as the above is in the form, it will be passed along as part of the parameters with the contents of the form during submit actions. As for Command parameters, I have managed to dynamically embed them in the ACTION attribute of my form tag. If you need to know how, feel free to email me on/off list. If you need anything more sophisticated, I will be happy to help out.
As for svc-fileupload-struts module let me take the responsibitity to merge it with the latest in CVS HEAD. I think it's my duty as I wrote the code for it -:) As Mike pointed out, the download piece to tackle binary data is already in place. So that side is done. Will merge the code over the weekend and you should have it ready by Monday morning.
Have a good weekend.
Regards.
Regards, Steve Santanu Dutt wrote: > Hi Steve, > First I did not get your querries on ModelAction. Could you please > send me the querries again? > >>/I have not yet heard from Santanu on the changes to Strut's ModelAction, >>but I have figured out a piece of his intent. Currently, the Strut's >>client drops all files that are uploaded to it. Uploaded files are NOT >>available for Models to work with./ >> > > This is wrong because the file data is available as byte[] to the > model. Look at FileUploadModel and the way it gets the file data and > writes it to the server directory. Also you can pass all other form > elements along with the file data to be processed in models. > Regards. > >>/ >>There are some other additions that were made to the Strut's ModelAction >>v1.0 that I would like to know the whys about as well, specificially the >>generation of two hidden fields, COMMAND & PARAMS. I don't think they >>are necessary with the enhancements for 2.0, but I want to be sure. >>Santanu? >>Philip?/ >> > COMMAND and PARAM are used to pass parameters pertaining to a > Command class when a particular button is clicked and the form is submitted. > It is definitely required in 1.0. About 2.0 I have to check but there > must be a way to pass parameters for button clicks to figure out > important things such as the process model to execute and so forth. > Regards. > Santanu > >>/ >
