struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Musachy Barroso" <musa...@gmail.com>
Subject Re: [S2] Problem with Date pattern
Date Thu, 14 Jun 2007 14:21:02 GMT
Make sure the inputName matches the name of the setter method, I assume you
have a getAnuncio() in your action whose result has a setDataInicial()
method right?

musachy

On 6/13/07, Diego Yasuhiko Kurisaki <diegoy@gmail.com> wrote:
>
> I'm using saveFormat=rfc and java.util.Date as my object
>
> My dojo is.
>
> <div dojoType="dropdowndatepicker" id="Anuncio_anuncio_dataInicial" name="
> dojo.anuncio.dataInicial" inputName="anuncio.dataInicial"
> displayFormat="dd/MM/yyyy" saveFormat="rfc" value="<s:property value="
> anuncio.fmtDataInicial"/>">
>
> and my setter
>
> public void setDataInicial(Date dataInicial) {
>         this.dataInicial = dataInicial;
> }
>
> I've tried to change my setter method to
>
> public void setDataInicial(Date dataInicial) {
>         SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
>         try {
>             this.dataInicial = dateFormat.parse(dataInicial);
>         } catch (ParseException e) {
>             // TODO Auto-generated catch block
>             e.printStackTrace();
>         }
> }
>
> But then my method was not even called...
>
>
> On 6/13/07, Musachy Barroso <musachy@gmail.com> wrote:
> >
> > Try using a Date object for your field, and set saveFormat="rfc" for the
> > widget.
> >
> > musachy
> >
> > On 6/13/07, Diego Yasuhiko Kurisaki <diegoy@gmail.com> wrote:
> > >
> > > I'm manually using the DojoTookit Date Picker withe the following
> > pattern
> > >
> > > dd/MM/yyy
> > >
> > > in my action i have a setter method like this.
> > >
> > > setDate(Date date){
> > > this.date = date
> > > }
> > >
> > > But it seens that the struts 2 when sets the method changes from
> > > dd/MM/yyyy
> > > for MM/dd/yyyy does anyone know any solution?
> > >
> > > I've tried to make a set method that receives String and then parse
> the
> > > date
> > > by myself. But the new setMethod was not called when  the form is
> > > submitted
> > > .
> > >
> > >
> > > On 6/13/07, Torsten Römer <torsten.roemer@luniks.net> wrote:
> > > >
> > > > Everytime my app starts, I see this in the log:
> > > >
> > > > 13.06.2007 23:50:27 org.apache.struts2.config.Settings getLocale
> > > > WARNUNG: Settings: Could not parse struts.locale setting,
> substituting
> > > > default VM locale
> > > >
> > > > I put
> > > >
> > > > <constant name="struts.locale" value="en_GB" />
> > > >
> > > > in my struts.xml, but I still get the error (and the default VM
> locale
> > > > is used, which I don't want)
> > > >
> > > > Torsten
> > > >
> > > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > > For additional commands, e-mail: user-help@struts.apache.org
> > > >
> > > >
> > >
> > >
> > > --
> > > []'s Diego Yasuhiko Kurisaki
> > >
> >
> >
> >
> > --
> > "Hey you! Would you help me to carry the stone?" Pink Floyd
> >
>
>
>
> --
> []'s Diego Yasuhiko Kurisaki
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message