Results 1 to 3 of 3
Thread: Number format Exception
- 01-29-2013, 12:48 PM #1
Member
- Join Date
- Jan 2013
- Posts
- 6
- Rep Power
- 0
Number format Exception
hello
Actually a situation is like i have a form in index.jsp file as :

and i have another file as newcard.jsp which looks like :

ok when i enter the mob no = 0123456789 OR 0987654321 , it works fine
but when i'm trying to enter no. like mob no =9876543210 OR 9927080800 OR 8877009944 , it throws an exception on newcard.jsp as :
org.apache.jasper.JasperException: java.lang.NumberFormatException: For input string: "8877009944"
i'm really confused what to do as exactly don't know where i'm going wrong...
so please help me with a solution and explaination
thanks in advance
- 01-29-2013, 01:52 PM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Re: Number format Exception
What is the maximum size of an int?
(Hint, it's less than the number you are trying to parse).
Also, a phone number is not an int.
It's a String that just happens to consist solely of digits.
For example:
01215551234
might be a valid phone number, but if you converted that to an int you would get:
1215551234
which is not the same.
ETA: Actually, just thought I'd add, it can also consist of a leading '+', if you're storing international dialling.Please do not ask for code as refusal often offends.
- 01-29-2013, 04:58 PM #3
Member
- Join Date
- Jan 2013
- Posts
- 6
- Rep Power
- 0
Similar Threads
-
Number format Exception
By aortell24 in forum New To JavaReplies: 5Last Post: 07-16-2012, 05:22 AM -
Number format
By asai in forum New To JavaReplies: 12Last Post: 06-21-2012, 10:24 AM -
Number Format Exception while parsing long
By Aamir in forum NetworkingReplies: 2Last Post: 05-15-2011, 02:57 AM -
catch the number format exception, where to place try
By aborgeld in forum New To JavaReplies: 7Last Post: 12-30-2010, 01:42 PM -
How to change number format of a field programmatically in Jasper?
By newbiejava in forum New To JavaReplies: 16Last Post: 09-04-2010, 04:03 AM


1Likes
LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks