Request processing failed; nested exception is java.lang.NullPointerException

后端 未结 2 1559
一个人的身影
一个人的身影 2021-01-16 17:38

i created a form and on post i want to save those values to the database and show the saved values on the page.
i am new to spring mvc and hence i am not understanding w

2条回答
  •  庸人自扰
    2021-01-16 18:22

    Seems to be a problem in your form. At least, the inputs must be given the name attributes:

     
    Cust_Id :
    Name :
    Age :

    But since you are using Spring, it is preferable to use the Spring forms (and spring url's also):

    
    
        Id:
         
    Name:
    Age:

    Edit And you should initialize dao!

    @Autowired
    private CustomerDao dao;
    

提交回复
热议问题