All properties on an ActionForm should be declared as Strings for this
very reason. 

After you have confirmed that only numerals were entered into the field,
THEN you can convert it to a business object that uses a binary type,
like int. 

The ActionForm is a buffer for whatever people enter into the form. It
is not a business object that you would use to represent the state of
your application or use as part of business logic processing. 

-- Ted Husted, Husted dot Com, Fairport NY US
-- Developing Java Web Applications with Struts
-- Tel: +1 585 737-3463
-- Web: http://husted.com/about/services


"Jivan, Rajiv" wrote:
> 
> I have a jsp which has an input field in which the user is supposed to enter only 
>integers.
> The form bean has a field of type int which is displayed as the default in the input 
>field using <html:text ...>
> When the user submits the form I want to validate the input field and make sure its 
>a number. The problem is that if it isn't a number when I display an error message 
>the original content which was entered in the field is lost as it reflects the data 
>in the form bean which is an integer.
> Is there is way to preserve it?
> 
> -----Original Message-----
> From: Galbreath, Mark [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 23, 2002 3:07 PM
> To: 'Struts Users Mailing List'
> Subject: RE: Need help with Token stuff - URGENT
> 
> Reid's still in jail.
> 
> -----Original Message-----
> From: JM [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 23, 2002 3:08 PM
> To: Struts Users Mailing List
> Subject: RE: Need help with Token stuff - URGENT
> 
> I promise....its not me.  Is that you Reid????
> 
> JM
> 
> > -----Original Message-----
> > From: Galbreath, Mark [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, May 23, 2002 2:46 PM
> > To: 'Struts Users Mailing List'
> > Subject: RE: Need help with Token stuff - URGENT
> >
> >
> > Good lord!  This sounds like one of James's joke questions to the list....
> >
> > [EMAIL PROTECTED] wrote:
> > >
> > > Hello guys,
> > >
> > > I still can't work with token stuff.
> > >
> > > If I have a JSP page with a menu, and when the user clicks in one
> > > option, it goes to another menu, which has a html:form and a submit
> > > button with an action associated. Where should I use the token
> > > associated methods ? where/when should I call saveToken ?
> > >
> > > thanks a lot
> > > Jefferson
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> >
> >
> 
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to