what is in the fileUpload interceptor stack? Since the setter is never
called, I would wonder if it is a complete stack.
When you use <interceptor-ref> in an action definition, you are
overwriting the existing stack with the stack you specify.
-Wes
On Sat, 2008-11-01 at 14:54 -0700, Nick J wrote:
> Hi, I am having some trouble with Uploads in Struts 2.
> Here is the action:
> <package name="uploads" extends="json-default" namespace="/_uploads">
> <!-- ...other actions ...-->
> <action name="imageUpload" class="uploadManager"
> method="imageUpload">
> <interceptor-ref name="fileUpload"/>
> <result>/upload.html</result>
> </action>
> </package>
>
> Here is the HTML form:
> <form name="myForm" action="/_uploads/imageUpload"
> enctype="multipart/form-data">
> <input type="file" name="imageUpload" value="Browse ..." />
> <input type="submit" />
> </form>
>
> Here's the appropriate part of the action class:
>
> public String imageUpload() {
> return ActionSupport.SUCCESS;
> }
>
> public List<Image> getImageList() {
> return images;
> }
>
> public void setImageUpload(File myImage) {
> uploadedImage = myImage;
> }
>
> public void setImageUploadContentType(String contentType) {
> imageContentType = contentType;
> }
>
> public void setImageUploadFileName(String filename) {
> imageFilename = filename;
> }
>
> I have debugger break-points in the imageUpload method, and in the setter
> methods.
> The execution never reaches the setters, and when it breaks in the
> imageUpload method,
> and I inspect the values of uploadedImage, imageContentType and
> imageFilename they are all null, so the interceptor has not called the the
> setters like I was expecting it to. As far as I can tell, this agrees with
> all the tutorials I've read, so I'm at a loss now. If anyone has any ideas,
> I'd be very greatful!
>
> thanks!
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]