Well, the java language gives you all you need for such thing.

You can use somthing like the following

String _is_it_int = "abc";

try {
  Integer _int = Integer.parseInt(_is_it_int) ;
} catch (NumberFormatException ex) {
  // This was not an int:
}

for parsing the values. Then you can make a check for the size.

If you do this often put it in your own input validation class.

But probably this is like reinventing the wheel.
frameworks like Turbine from Apache should provide the same
functionality.

-Henning


Jackson Ching wrote:
>
> Hi,
>
>     How can i handle overflows in java?
>
>     scenario: Webpage form accepts numeric values. Form past to servlet for 
>processing. What if my servlet contains an int data type and the form data contains 
>value that exceed the limit of java int. how can i handle this? Limitting/checking 
>using java script or vbscript is not really an option since user who wants to crash 
>the system may modify the html page. I'm thinking more on server-side checking. 
>Thanks in advance.
>
> Jack
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to