i am developing an application in struts2 and trying to used object backed data transfer method in struts2 i have created a bean namely address where i have declared all the properties.
Now i want that my struts2 intercepter will fill this beans by itself when it called,below is the code snap i have written in my REgsitration class
public class UserRegistrationAction extends ActionSupport {
/** * */ private static final long serialVersionUID = 1L;
public String execute() throws Exception{ System.out.println("test"); System.out.println("test1 "+getAddressBean().getCity());
return SUCCESS; }
private AddressBean addressBean;
/** * @return the addressBean */ public AddressBean getAddressBean() { return addressBean; }
/** * @param addressBean the addressBean to set */ public void setAddressBean(AddressBean addressBean) { this.addressBean = addressBean; } }
but when i am running this aplication i am getting the Null POINTER exception on server