一、准备工作及实例.............................................................................................................................................3
1.解压 struts-2.1.6-all.zip................................................................................................................................3
2.六个基本包..................................................................................................................................................3
3.初识 struts2 配置文件..................................................................................................................................3
(1).web.xml 文件............................................................................................................................4
(2).struts.xml 文件..........................................................................................................................4
(3).struts.properties(参 default.properties)................................................................................4
(4)struts-default.xml...........................................................................................................................4
(5)其它配置文件...............................................................................................................................4
4.让 MyEclipse 提示 xml 信息.......................................................................................................................4
5.如何使用 alt+/提示......................................................................................................................................4
6.实例..............................................................................................................................................................4
7.开启 struts2 自带的开发模式常量.............................................................................................................6
8.vo 传参模式.................................................................................................................................................7
9.ModerDriven 传参模式(不建议采用)........................................................................................................7
10.为什么要使用 struts2 代替 struts1.x.........................................................................................................7
二、struts.xml 配置及例程....................................................................................................................................8
1.配置文件的优先级......................................................................................................................................8
2.配置形式......................................................................................................................................................8
3.package 配置相关........................................................................................................................................8
4.分工合作 include:指定多个配置文件......................................................................................................10
5.tomcat 认证访问........................................................................................................................................10
6.初识拦截器................................................................................................................................................11
7.Action 中的 method 属性...........................................................................................................................12
8.使用 ForwardAction 实现页面屏蔽。......................................................................................................14
8.使用 default-Action 配置统一访问...........................................................................................................14
小结 Action...........................................................................................................................................14
9.使用通配符................................................................................................................................................15
10.使用 0 配置:ZERO Annotation.............................................................................................................15
11.Result 配置详解.......................................................................................................................................15
探讨 type 类型:..................................................................................................................................16
Type 类型值..................................................................................................................................................16
作用说明.......................................................................................................................................................16
对应类...........................................................................................................................................................16
chain...............................................................................................................................................................16
用来处理 Action 链......................................................................................................................................16
com.opensymphony.xwork2.ActionChainResult..........................................................................................16
dispatcher.......................................................................................................................................................16
用来转向页面,通常处理 JSP....................................................................................................................16
org.apache.struts2.dispatcher.ServletDispatcherResult................................................................................16
redirect...........................................................................................................................................................16
重定向到一个 URL......................................................................................................................................16
org.apache.struts2.dispatcher.ServletRedirectResult....................................................................................16
redirectAction................................................................................................................................................16
重定向到一个 Action...................................................................................................................................16
org.apache.struts2.dispatcher.ServletActionRedirectResult.........................................................................16
plainText........................................................................................................................................................16