I am working on a web application in which data will be transfer between client & server side.
I already know that JavaScript int != Java int. Because, Java int
Perhaps you have the compiler settings for your IDE set to Java 1.4 mode even if you are using a Java 5 JDK? Otherwise I agree with the other people who already mentioned autoboxing/unboxing.