<package name="default" namespace="/" extends="struts-default">
<action name="hellowrold_*" method="{1}" class="cn.HelloWroldaction">
<result>/result.jsp</result>
<result name="add">/{1}.jsp</result>
<result name="update">/{1}.jsp</result>
</action>
</package>
package cn;
import com.opensymphony.xwork2.ActionSupport;
@SuppressWarnings("serial")
public class HelloWroldaction extends ActionSupport {
public String add(){
return SUCCESS;
}
public String update(){
return "update";
}
@Override
public String execute() throws Exception {
// TODO Auto-generated method stub
System.out.println("action is start!");
return "fail";
}
}