<?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: 包. struts2 使用 package 来组织模块.
name 属性: 必须. 用于其它的包应用当前包.
extends: 当前包继承哪个包, 继承的, 即可以继承其中的所有的配置. 通常情况下继承 struts-default
struts-default 这个包在 struts-default.xml 文件中定义.
namespace 可选, 如果它没有给出, 则以 / 为默认值.
若 namespace 有一个非默认值, 则要想调用这个包里的Action,
就必须把这个属性所定义的命名空间添加到有关的 URI 字符串里 http://localhost:8080/contextPath/namespace/actionName.action
-->
<package name="helloWorld" extends="struts-default"> <!--
配置一个 action: 一个 struts2 的请求就是一个 action
name: 对应一个 struts2 的请求的名字(或对一个 servletPath, 但去除 / 和扩展名), 不包含扩展名
class 的默认值为: com.opensymphony.xwork2.ActionSupport
method 的默认值为: execute
result: 结果.
-->
<action name="product-input" class="com.opensymphony.xwork2.ActionSupport" method="execute">
<!--
result: 结果. 表示 action 方法执行后可能返回的一个结果. 所以一个 action 节点可能会有多个 result 子节点.
多个 result 子节点使用 name 来区分
name: 标识一个 result. 和 action 方法的返回值对应. 默认值为 success
type: 表示结果的类型. 默认值为 dispatcher(转发到结果.)
-->
<result name="success" type="dispatcher">/WEB-INF/pages/input.jsp</result>
</action> <action name="product-save" class="com.atguigu.struts2.helloworld.Product" method="save">
<result name="details">/WEB-INF/pages/details.jsp</result>
</action> <action name="test" class="com.atguigu.struts2.helloworld.Product" method="test">
<result>/index.jsp</result>
</action> </package> </struts>

Struts2 - 配置文件详解的更多相关文章

  1. Struts2配置文件详解

    解决在断网环境下,配置文件无提示的问题我们可以看到Struts.xml在断网的情况下,前面有一个叹号,这时,我们按alt+/ 没有提示,这是因为” http://struts.apache.org/d ...

  2. strct配置文件详解

    1,strct配置文件详解 <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configurati ...

  3. Struts2常量详解

    -----------------siwuxie095 Struts2 常量详解 Struts2 的常量大多在默认的配置文件中已经配置好,但根据 用户需求和开发要求的不同,可能需要修改这些常量值,修改 ...

  4. quartz配置文件详解

    quartz配置文件详解(转载)     quartz学习总结: 一.关于job:    用Quartz的行话讲,作业是一个执行任务的简单Java类.任务可以是任何Java代码.只需你实现org.qu ...

  5. WebConfig配置文件详解

    今天看到博客园一位朋友整理的一个WebConfig配置文件详解,觉得不错,转载一下: <?xml version="1.0"?> <!--注意: 除了手动编辑此文 ...

  6. tomcat配置文件详解

    Tomcat系列之服务器的安装与配置以及各组件详解   tomcat 配置文件详解

  7. ubuntu nginx 安装以及配置文件详解

    1.到nginx官网下载源码包.最好下载稳定版本,nginx官网http://www.nginx.org/ 2.安装nginx依赖包运行命令: sudo apt-get install libssl- ...

  8. Spring配置文件详解 – applicationContext.xml文件路径

    Spring配置文件详解 – applicationContext.xml文件路径 Java编程                 spring的配置文件applicationContext.xml的默 ...

  9. spring配置文件详解--真的蛮详细

    spring配置文件详解--真的蛮详细   转自: http://book.51cto.com/art/201004/193743.htm 此处详细的为我们讲解了spring2.5的实现原理,感觉非常 ...

随机推荐

  1. Unity合并选中物体的Mesh

    using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEditor; pu ...

  2. ios -富文本和尺寸

    /** *  计算文本的宽高 方法 2 * *  @param str     需要计算的文本 *  @param font    文本显示的字体 *  @param maxSize 文本显示的范围 ...

  3. windows下php配置redis

    方法/步骤 1.使用phpinfo()函数查看PHP的版本信息,这会决定扩展文件版本   2.根据PHP版本号,编译器版本号和CPU架构, 选择php_redis-2.2.5-5.5-ts-vc11- ...

  4. iOS表格制作

    由于项目上的需求,需要做一个表格出来,来显示流程状态.刚开始脑子一头雾水,没有一点思路,但是靠着自己的座右铭--“世上无难事,只怕有心人”,克服了所有困难.好,不说了,讲正事. 制作表格,还是需要ta ...

  5. 【BZOJ2322】[BeiJing2011]梦想封印 高斯消元求线性基+DFS+set

    [BZOJ2322][BeiJing2011]梦想封印 Description 渐渐地,Magic Land上的人们对那座岛屿上的各种现象有了深入的了解. 为了分析一种奇特的称为梦想封印(Fantas ...

  6. 【BZOJ1109】[POI2007]堆积木Klo 二维偏序

    [BZOJ1109][POI2007]堆积木Klo Description Mary在她的生日礼物中有一些积木.那些积木都是相同大小的立方体.每个积木上面都有一个数.Mary用他的所有积木垒了一个高塔 ...

  7. poj 3714 Raid【(暴力+剪枝) || (分治法+剪枝)】

    题目:  http://poj.org/problem?id=3714 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=27048#prob ...

  8. elasticsearch从入门到出门-08-Elasticsearch容错机制:master选举,replica容错,数据恢复

    假如: 9 shard,3 node Elasticsearch容错机制:master选举,replica容错,数据恢复 最佳分配情况: 这样分配之后,不管其中哪个node 宕机这个es 依然可以提供 ...

  9. C语言之基本算法12—谁是冠军

    /* ================================================================== 题目:甲乙丙丁四人猜A,B,C,D,E,F6个人谁是冠军,甲 ...

  10. 移动端 触摸事件 ontouchstart、ontouchmove、ontouchend、ontouchcancel[转]

    转:http://www.cnblogs.com/irelands/p/3433628.html 1.Touch事件简介pc上的web页面鼠 标会产生onmousedown.onmouseup.onm ...