Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 SimpleFormController 正在获取 nullpointer 异常,任何人都可以建议我如何从数据库中检索记录并在浏览器中显示它......
问候 srikar thnx
这将取决于什么属性给你 NullPointerException (NPE)。如果您使用的是 Spring MVC,那么您的 DAO 或 Manager 很可能正在为您提供 NPE,因为在您尝试使用它之前它还没有被初始化。
您能否在您声明 DAO 或 Manager 的控制器中分享您的代码?
好的,看看你的代码,我想你会在这一行收到你的 NPE:
ArrayList list = (ArrayList)edao.findAll();
我将开始查看 EmpJB 类并确保您已初始化所有相关属性。