struts2+spring2整合的一个让我苦B的问题
环境:tomcat7
spring2.5.6
struts2 2.2.1.1
整合后,action类承继ActionSupport类时,就没办法执行到我写的action类的方法。如:
public class HelloAction extends ActionSupport{
public String exea(){
System.out.println("----a");
try{
System.out.println("------------------x");
Logger.getLogger("").info("xxxx---");
}catch(Exception e){
e.printStackTrace();
Logger.getLogger("").error(e);
}
return "hello";
}
public String execute(){
System.out.println("abc");
return "ok";
}
}
要调用该action类的exea方法,url是:http://localhost:8080/ods/helloAction!exea.do
啥都没打印出来,就直接进入如下配置的input:
<action name="helloAction!*" method="{1}" class="helloAction">
<result name="hello">login.jsp</result>
<result name="input">login.jsp</result>
</action>
这很让我郁闷,如把HelloAction 类的继承去掉,在cronsle控制台就能打印出:
----a
------------------x
郁闷,很久没做前台开发,望大家给我分析一下,谢谢!