spring - Request processing failed; nested exception is java.lang.NumberFormatException: null -



spring - Request processing failed; nested exception is java.lang.NumberFormatException: null -

i'm getting error request processing failed; nested exception java.lang.numberformatexception: null.

here code:

@controller @requestmapping("/customeradmin") public class customeradmincontroller { @initbinder public void initbinder(webdatabinder binder) { binder.registercustomeditor(customer.class, "customer", new propertyeditorsupport() {@ override public void setastext(string customer) { setvalue(new customer(integer.parseint(customer))); } }); } @requestmapping(value = "/addprofile.htm", method = requestmethod.get) public modelandview addprofileform(modelmap model, httpservletrequest request) { int id = integer.parseint(request.getparameter("id")); system.out.println(id); profile profile = new profile(); client customer = new customer(id); profile.setcustomer(customer); model.addattribute("profile", profile); modelandview mav = new modelandview("addprofile"); homecoming mav; } }

am getting error as

oct 16, 2014 4:31:47 pm invoke

severe: servlet.service() servlet [dispatcherservlet] in context path [/customerportal] threw exception [request processing failed; nested exception java.lang.numberformatexception: null] root cause

try adding this:

int id = integer.parseint(request.getparameter("id"));

java spring hibernate spring-mvc

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -