What is a 'good-practice' method of validating a numeric string?
Ive been lazy and am doing a Integer.parseInt() in a try catch but its
probably far from the best way...
(Have been meaning to check out the java.text.NumberFormat stuff but always
had more interes... uh... important things to do first and havent had time
yet...)

-----Original Message-----
From: Galbreath, Mark [mailto:Galbreath@;tessco.com]
Sent: Thursday, October 31, 2002 20:13
To: 'Struts Users Mailing List'
Subject: RE: MVC Design: property in ActionForm or Bean with property in
A ctionForm ?


Check out the static methods of the java.lang.Character class.  isDigit()
should solve your dilemma.

Mark

-----Original Message-----
From: Marcus Biel [mailto:Marcus.Biel@;bmw.de]
Sent: Thursday, October 31, 2002 7:04 AM

yes of course I know!
But how can I be sure that this "String" is a "Integer" ?

I mean I can simply convert this String to an Integer,
but I doubt this would help, cause a String can get converted to an
Integer.
(Like A is 65 I think)

So how can I be sure that the user typed 65 and not A ?

Marcus


[EMAIL PROTECTED] schrieb:
>
> Are you kidding?  Dude, everything typed in an HTML form is a string.  You
> have to do some validation.
>
> Mark

--
To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@;jakarta.apache.org>

--
To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@;jakarta.apache.org>


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>

Reply via email to