mybatis+strus 写ET学生管理系统
Unable to instantiate Action,,,,,,,,,defined for ',,,' in namespace '/,,,'null 异常
新浪上找到解决建议:struts2的执行原理是当一个request请求过来之后struts2拦截器根据其配置文件的解析然后再初始化并执行不同的java类,而之所以会出现上面的问题则是因为在初始化java类的时候在java类里面初始化了ActionContext的的一些对象,所以不要再java类里面去初始化一些struts2的类一般则是在定义全局变量时定义生成了一些ActionContext的对象之类的,
Struts Problem Report
Struts has detected an unhandled exception:
Messages: |
|
File: | com/etoak/action/StudentAction.java |
Line number: | 30 |
Stacktraces
Unable to instantiate Action, com.etoak.action.StudentAction, defined for 'addStudent' in namespace '/'null - action - file:/F:/tomcat/apache-tomcat-6.0.29-windows-x86/apache-tomcat-6.0.29/webapps/Student_ManageSystem/WEB-INF/classes/struts.xml:9:23