I'm working with JavaEE i need to convert this: request.getParameter("id") to int. The value of request.getParameter("id") is "9" (String).
When I'm trying to convert to int I have
java.lang.NumberFormatException
I've tried java.lang.Integer.parseInt(request.getParameter("id")) and request.getParameter("id",10) but it donsen't works...
Any solutions? Thank you.
trim()it before callingparseInt()java.lang.Integer.parseInt(request.getParameter("id").trim()). If that doesnt work maybe try printing out the character codes in the string.trim()the string. What do you think?