Nullpointerexception while setting a bean
问题 I have an action URL after clicking a hyper link like so /SocialStupendous/GetProfile.action?slno=3&slno=3 In my execute method of ActionClass I have the following code public String execute() { int urislno=Integer.parseInt(getServletRequest().getParameter("slno")); System.out.println(urislno); bean.setUslno(urislno); } I am getting NullPointerException when I am performing bean.setuslno(urislno) . Even though urislno is printed properly as 3 . ProfileBean class: public class ProfileBean {