也是404错误还说No result defined for action action.HelloAction and result success。有人遇到相同问题吗
解决了,return SUCCESS;相当于return “success”;
struts.xml改成<result name="success">/index.jsp</result>
HelloAction.java
package action;
import com.opensymphony.xwork2.ActionSupport;
public class HelloAction extends ActionSupport {
/**
*
*/
private static final long serialVersionUID = 1L;
@Override
public String execute() throws Exception {
System.out.println("执行Action");
return SUCCESS;
}
}
struts.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
"http://struts.apache.org/dtds/struts-2.3.dtd">
<struts>
<package name="default" namespace="/" extends="struts-default">
<action name="HH" class="action.HelloAction">
<result>/index.jsp</result>
</action>
</package>
</struts>