Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

Re: [S2] Ajax form and file submission with s:a

Musachy Barroso

2007-01-14

Replies:

I've never tried that myself, but if dojo.bind() supports submission of
forms with files, then it should be possible.

//did you ever figure out the problem with the date?

regards
musachy

Dariusz Wojtas wrote:
> Hi,
>
> I have a form declared this way:
>
> <s:form action="/my.action"
>   theme="ajax"
>   method="POST"
>   enctype="multipart/form-data">
>   <s:hidden name="parentId"/>
>     ...
>     <s:a theme="ajax" title="Save" targets="attDiv">Save</s:a>
>     ...
>     ...
>     <s:file name="myFile" label="File"/>
>     <s:textarea name="desc" theme="simple" label="Desc"/>
> </s:form>
>
>
> file declaration:
>  private java.io.File myFile  // +getter/setter
>
> When I press the link and there is no s:file element, the form gets
> submitted.
> But if the file is in the form, pressing the link makes request to:
>  http://localhost:8080/myApp/struts/dojo/iframe_history.html?noInit=true
>  [as shown by FF 2.0, using FireBug]
> and the request is not passed to the server.
> Firefox shows:
>   [object HTMLDocument]
> in the target div instead of the expected content.
>
>
> It's difficult to say what exactly IE is doing because it fails as
> even the hidden param is not passed with the request. But IE at least
> makes that request to the server.
>
> Is submission of forms with files supperted by S2?
> I am using S2 trunk.
>
> Regards
> Dariusz Wojtas
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.