<?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="*_*" method="{2}" class="com.study.struts.action.{1}Action">
<result>/result.jsp</result>
<result name="add">{2}.jsp</result>
<result name="update">/update.jsp</result>
</action>
</package>
</struts>
package com.study.struts.action;
import com.opensymphony.xwork2.ActionSupport;
public class FirstAction extends ActionSupport {
public String add(){
System.out.println("add action.......");
return SUCCESS;
}
public String update(){
System.out.println("update action.......");
return SUCCESS;
}
@Override
public String execute() throws Exception {
System.out.println("First action ---------------------");
return SUCCESS;
}
}