<?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>
<!-- DMI 动态方法调用 !后跟action里的方法面 -->
<constant name= "struts.enable.DynamicMethodInvocation" value ="true" />
<!-- 修改本页面可不用重新加载 tomcat,上传文件处理时需要将value=false -->
<constant name ="struts.devMode" value="true" />
<!-- name可以随意起 namespace 区分模块不要随意改动,如果改成/book 在browser地址栏项目明后添加/book/对应的action -->
<package name ="default" namespace="/" extends= "struts-default">
<action name ="index">
<result >/index.jsp </result >
</action >
<!-- method后为默认跳转方法 -->
<action name ="test" class="com.cola.struts.Test" method= "show">
<result >/test.jsp </result >
</action >
<!-- 加上通配符* action后直接跟方法名 -->
<!-- <action name="book*" class="com.cola.struts.BookAction" method="{1}"
> <result name="success">/{1}. jsp</result> </action> -->
<!-- *的顺序对应{}里的数字 -->
<!-- <action name="*_*" class="com.cola.struts.{1}Action" method="{2}"
> <result name="success">/{1}_{2}.jsp</result> </action> -->
<action name ="book" class= "com.cola.struts.BookAction">
<result name= "success">/book_value.jsp</result >
</action >
<action name ="user" class= "com.cola.struts.UserAction">
<result name= "success">/book_value.jsp</result >
</action >
</package >
<package name ="user" namespace="/user" extends= "default">
<action name ="index">
<result >/test.jsp </result >
</action >
</package >
</struts>
原文地址:http://icola.blog.51cto.com/5412204/1721689