java - SSH 实现类的空指针问题
PHPz
PHPz 2017-04-18 09:29:15
0
4
361
PHPz
PHPz

学习是最好的投资!

reply all(4)
大家讲道理

1. Post the complete exception information of the NullPointerException report.
2. Post the execute method in LoginAction. It seems that you use JDK reflection in your code.

Generally, the problem of null pointers can be easily solved. Find the location of the null pointer, and then apply an outer layer of judgment. If it is not a null pointer, you can enter the code. But if reflection is used, you have to find the place where the reflection code is mapped by reflection. If a null pointer is passed in, then you need to regulate it at the entrance~~

伊谢尔伦

You should use reflection injection. adminDao may be null and not injected. See if there is a setter method

迷茫

It should be that adminDao is null, and it was not injected successfully during injection. You can check the problem of dependency injection

阿神

It should be that adminDao is null. Check to see if there are set and get methods, and whether adminDao is declared in applicationContext.xml

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template