struts2.3 动态方法调用报错的问题
struts.xml:
<struts>
<package name="default" extends="struts-default">
<action name="login" class="com.wjf.action.LoginAction">
<result name="success">/showmsg.jsp</result>
</action>
</package>
</struts>
public class LoginAction implements Action{
private String msg;
public String getMsg() {
return msg;
}
public String execute() throws Exception {
msg = "execute";
return SUCCESS;
}
public String addUI(){
msg = "addUI";
return SUCCESS;
}
}
java.lang.NullPointerException
org.apache.struts2.impl.StrutsActionProxy.getErrorMessage(StrutsActionProxy.java:69)
com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:185)
org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:63)
org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39)
com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:58)
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:553)
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:434)