简体   繁体   中英

how to retrieve the record from database by using spring 2.0 with hibernate springMVC

Am using SimpleFormController am getting nullpointer Exception can any one please suggest the how can i retrieve record from database and display it in browser....

regards srikar thnx

It would depend on what property is giving you the NullPointerException (NPE). If you're using Spring MVC then it's likely that your DAO or Manager is giving you the NPE because it hasn't been initialized before you attempt to use it.

Could you share your the code in your Controller where you declare either your DAO or Manager?

Okay, looking at your code I would imagine you're receiving your NPE at this line:

ArrayList list = (ArrayList)edao.findAll();

I would begin looking at the EmpJB class and ensure you have all of the dependent properties initialized.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM