You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dariusz Wojtas <dw...@gmail.com> on 2007/01/14 00:45:34 UTC

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

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@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


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

Posted by Dariusz Wojtas <dw...@gmail.com>.
Please have a look at :
  https://issues.apache.org/struts/browse/WW-1598

Dariusz Wojtas

On 1/14/07, Martin Gainty <mg...@hotmail.com> wrote:
> Darius/Muscachy-
>
> http://trac.dojotoolkit.org/search?q=1598&ticket=on&changeset=on&wiki=on
> 1598 isnt on the dojo buglist.. and ...neither is Error setting expression 'timeProp' with value
>
> Did I mis-understand?
>
> M-

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


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

Posted by Martin Gainty <mg...@hotmail.com>.
Darius/Muscachy-

http://trac.dojotoolkit.org/search?q=1598&ticket=on&changeset=on&wiki=on
1598 isnt on the dojo buglist.. and ...neither is Error setting expression 'timeProp' with value

Did I mis-understand?

M-
--------------------------------------------------------------------------- 
This e-mail message (including attachments, if any) is intended for the use of the individual or entity to which it is addressed and may contain information that is privileged, proprietary , confidential and exempt from disclosure. If you are not the intended recipient, you are notified that any dissemination, distribution or copying of this communication is strictly prohibited.
--------------------------------------------------------------------------- 
Le présent message électronique (y compris les pièces qui y sont annexées, le cas échéant) s'adresse au destinataire indiqué et peut contenir des renseignements de caractère privé ou confidentiel. Si vous n'êtes pas le destinataire de ce document, nous vous signalons qu'il est strictement interdit de le diffuser, de le distribuer ou de le reproduire.
----- Original Message ----- 
From: "Dariusz Wojtas" <dw...@gmail.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Sunday, January 14, 2007 11:08 AM
Subject: Re: [S2] Ajax form and file submission with s:a


> Hi Musachy,
> 
> Is there any chance to ... check the file submission with an anchor?
> Does not work for me.
> 
> And IE still has plenty of problems with param passing.
> I tried to reopen WW-1598 yesterday - but I do not have enough rights.
> I just ended with adding a comment. (what should I do in such case?
> create a new issue?)
> 
> 
> Dates.
> 
> The s:datetimepicker tag works nicely now when it is configured for
> 'date', but if fails for 'time'  (backed by a java.util.Date
> property).
> datetimepicker of type 'date' sends 2 properties in the request
>    dateProp
>    dojo.dateProp
> but time property only sends single property
>    timeProp
> and I can observe an error message in logs:
> 
> 16:57:01,656 ERROR - ParametersInterceptor      -
> ParametersInterceptor - [setParameters]: Unexpected Exception catched:
> Error setting expression 'timeProp' with value
> '[Ljava.lang.String;@18806f7'
> 
> <s:datetimepicker
>    name="timeProp"
>    language="pl"
>    type="time"
>    label="Time ..."/>
> 
> I have a form of theme 'ajax' and datetime properties still do not
> generate table row.
> I am saying that as I am not sure how our last discussion ended and
> what you are exactly asking for :)
> 
> Using yestardays trunk build.
> 
> regards
> Dariusz Wojtas
> 
> On 1/14/07, Musachy Barroso <mb...@wfscorp.com> wrote:
>> 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@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
>

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

Posted by Dariusz Wojtas <dw...@gmail.com>.
Hi Musachy,

Is there any chance to ... check the file submission with an anchor?
Does not work for me.

And IE still has plenty of problems with param passing.
I tried to reopen WW-1598 yesterday - but I do not have enough rights.
I just ended with adding a comment. (what should I do in such case?
create a new issue?)


Dates.

The s:datetimepicker tag works nicely now when it is configured for
'date', but if fails for 'time'  (backed by a java.util.Date
property).
datetimepicker of type 'date' sends 2 properties in the request
    dateProp
    dojo.dateProp
but time property only sends single property
    timeProp
and I can observe an error message in logs:

16:57:01,656 ERROR - ParametersInterceptor      -
ParametersInterceptor - [setParameters]: Unexpected Exception catched:
Error setting expression 'timeProp' with value
'[Ljava.lang.String;@18806f7'

<s:datetimepicker
    name="timeProp"
    language="pl"
    type="time"
    label="Time ..."/>

I have a form of theme 'ajax' and datetime properties still do not
generate table row.
I am saying that as I am not sure how our last discussion ended and
what you are exactly asking for :)

Using yestardays trunk build.

regards
Dariusz Wojtas

On 1/14/07, Musachy Barroso <mb...@wfscorp.com> wrote:
> 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@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


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

Posted by Musachy Barroso <mb...@wfscorp.com>.
The timepicker is indeed broken, I haven't been able to extend the dojo 
widget to fix it because it is throwing some errors (even if my widget 
is empty!). Just to let you know :)

musachy

Dariusz Wojtas wrote:
> Musachy!
>
> I must have been blind (no wine today).
> I checked again the datetimepicker in the ajax form - but I can
> clearly see that it nicely generates a table row with 2 columns.
> I am sorry for the wrong message before - it's blindness.
>
> [time is still not recognized]
>
> Best regards
> Dariusz Wojtas
>
> On 1/14/07, Musachy Barroso <mb...@wfscorp.com> wrote:
>> 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
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


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

Posted by Martin Gainty <mg...@hotmail.com>.
for some reason when I reference example.jsp from struts-showcase-2.0.1 struts-showcase-2.0.1\tags\ui\example.jsp I see the error
favouriteLanguages key not found
which properties file contains this key?

    <s:select
            tooltip="Choose Your Favourite Language"
            label="Favourite Language"
            list="favouriteLanguages"
            name="favouriteLanguage"
            listKey="key"
            listValue="description"
            emptyOption="true"
            headerKey="None"
            headerValue="None"/>

here is the exception
org.apache.jasper.JasperException: tag 'select', field 'list', name 'favouriteLanguage': The requested list key 'favouriteLanguages' could not be resolved as a collection/array/map/enumeration/iterator type. Example: people or people.{name}
	org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:248)
	com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118)
	com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)
	org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:118)
???M---------------------------------------------------------------------------- 
This e-mail message (including attachments, if any) is intended for the use of the individual or entity to which it is addressed and may contain information that is privileged, proprietary , confidential and exempt from disclosure. If you are not the intended recipient, you are notified that any dissemination, distribution or copying of this communication is strictly prohibited.
--------------------------------------------------------------------------- 
Le présent message électronique (y compris les pièces qui y sont annexées, le cas échéant) s'adresse au destinataire indiqué et peut contenir des renseignements de caractère privé ou confidentiel. Si vous n'êtes pas le destinataire de ce document, nous vous signalons qu'il est strictement interdit de le diffuser, de le distribuer ou de le reproduire.
----- Original Message ----- 
From: "Dariusz Wojtas" <dw...@gmail.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Sunday, January 14, 2007 1:01 PM
Subject: Re: [S2] Ajax form and file submission with s:a


> Musachy!
> 
> I must have been blind (no wine today).
> I checked again the datetimepicker in the ajax form - but I can
> clearly see that it nicely generates a table row with 2 columns.
> I am sorry for the wrong message before - it's blindness.
> 
> [time is still not recognized]
> 
> Best regards
> Dariusz Wojtas
> 
> On 1/14/07, Musachy Barroso <mb...@wfscorp.com> wrote:
>> 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
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
>

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

Posted by Dariusz Wojtas <dw...@gmail.com>.
Thanks for the tips.
Looks like string is the only option for now with timepicker.
It's not a serious issue once you understand the limitation.

Most of the issues that were really hurting me are gone.

The most important issue is now the remote form submission problem ...
Even simple remote forms have problems with param passing.
I had no ajax background before, but when I understood how useful this is -
I started to love it.

Observing how JIRA issues are shuffled around I can make some
conclusions about the GA. Any chance to have this fixed before?
If this was only about Java code - I could try to fix something
myself, propose something.
But with Javascript ... I can't do much.

Dariusz Wojtas


On 1/15/07, Musachy Barroso <mb...@wfscorp.com> wrote:
> Sorry for the name misspelling :)
>
> musachy
>
> Musachy Barroso wrote:
> > Dariouz
> >
> > There are two problems with the time picker tag, one is that xwork
> > doesn't support dates in RFC3399 format (only the SHORT, MEDIUM and
> > LONG from DateFormat), for that I attached a patch here:
> >
> > https://issues.apache.org/struts/browse/WW-1643
> >
> > xwork was just released, so I don't think this will get applied
> > anytime soon. The other problem is the Dojo widget DropDownTimePicker
> > which  is broken, here is the tracking issue:
> >
> > http://trac.dojotoolkit.org/ticket/1677
> >
> > I attached a patch with the explanation to:
> >
> > https://issues.apache.org/struts/browse/WW-1644
> >
> > As a workaround, while this gets sorted out, use "String" for your
> > date field.
> >
> > musachy
> >
> > Dariusz Wojtas wrote:
> >> Musachy!
> >>
> >> I must have been blind (no wine today).
> >> I checked again the datetimepicker in the ajax form - but I can
> >> clearly see that it nicely generates a table row with 2 columns.
> >> I am sorry for the wrong message before - it's blindness.
> >>
> >> [time is still not recognized]
> >>
> >> Best regards
> >> Dariusz Wojtas
> >>
> >> On 1/14/07, Musachy Barroso <mb...@wfscorp.com> wrote:
> >>> 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

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


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

Posted by Musachy Barroso <mb...@wfscorp.com>.
Sorry for the name misspelling :)

musachy

Musachy Barroso wrote:
> Dariouz
>
> There are two problems with the time picker tag, one is that xwork 
> doesn't support dates in RFC3399 format (only the SHORT, MEDIUM and 
> LONG from DateFormat), for that I attached a patch here:
>
> https://issues.apache.org/struts/browse/WW-1643
>
> xwork was just released, so I don't think this will get applied 
> anytime soon. The other problem is the Dojo widget DropDownTimePicker 
> which  is broken, here is the tracking issue:
>
> http://trac.dojotoolkit.org/ticket/1677
>
> I attached a patch with the explanation to:
>
> https://issues.apache.org/struts/browse/WW-1644
>
> As a workaround, while this gets sorted out, use "String" for your 
> date field.
>
> musachy
>
> Dariusz Wojtas wrote:
>> Musachy!
>>
>> I must have been blind (no wine today).
>> I checked again the datetimepicker in the ajax form - but I can
>> clearly see that it nicely generates a table row with 2 columns.
>> I am sorry for the wrong message before - it's blindness.
>>
>> [time is still not recognized]
>>
>> Best regards
>> Dariusz Wojtas
>>
>> On 1/14/07, Musachy Barroso <mb...@wfscorp.com> wrote:
>>> 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
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


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

Posted by Musachy Barroso <mb...@wfscorp.com>.
Dariouz

There are two problems with the time picker tag, one is that xwork 
doesn't support dates in RFC3399 format (only the SHORT, MEDIUM and LONG 
from DateFormat), for that I attached a patch here:

https://issues.apache.org/struts/browse/WW-1643

xwork was just released, so I don't think this will get applied anytime 
soon. The other problem is the Dojo widget DropDownTimePicker which  is 
broken, here is the tracking issue:

http://trac.dojotoolkit.org/ticket/1677

I attached a patch with the explanation to:

https://issues.apache.org/struts/browse/WW-1644

As a workaround, while this gets sorted out, use "String" for your date 
field.

musachy

Dariusz Wojtas wrote:
> Musachy!
>
> I must have been blind (no wine today).
> I checked again the datetimepicker in the ajax form - but I can
> clearly see that it nicely generates a table row with 2 columns.
> I am sorry for the wrong message before - it's blindness.
>
> [time is still not recognized]
>
> Best regards
> Dariusz Wojtas
>
> On 1/14/07, Musachy Barroso <mb...@wfscorp.com> wrote:
>> 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
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


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

Posted by Dariusz Wojtas <dw...@gmail.com>.
Musachy!

I must have been blind (no wine today).
I checked again the datetimepicker in the ajax form - but I can
clearly see that it nicely generates a table row with 2 columns.
I am sorry for the wrong message before - it's blindness.

[time is still not recognized]

Best regards
Dariusz Wojtas

On 1/14/07, Musachy Barroso <mb...@wfscorp.com> wrote:
> 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

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


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

Posted by Musachy Barroso <mb...@wfscorp.com>.
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@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org