1.result类型:result 若不指定默认为type="dispatcher"意为运用服务器跳转也就是jspforward到一个
jsp文件去或者是html或是其他地如freemarker但不能是action。type="redirect"也只能跳转到这些页
面上去类似"dispatcher"但为客户端跳转即服务器告知客户端要redirect的页面地址由客户端在发起
对该地址的请求。而type="chain"意为跳转到一个action,用forward方式访问action,客户端跳转到一
个action为"redirectAction"。
<package name="resultTypes" namespace="/r" extends="struts-default">//extends="struts-default"重要
要加上
<action name="r1">
<result type="dispatcher">/r1.jsp</result>
</action>
<action name="r2">
<result type="redirect">/r2.jsp</result>
</action>
<action name="r3">
<result type="chain">r1</result>
</action>
<action name="r4">
<result type="redirectAction">r2</result>
</action>
</package>
跳转到其他包中的action
<result type="chain">
<param name="actionName">dashboard</param>
<param name="namespace">/spname</param>
</result>
freemarker
httpheader 就是发一个http的头信息过去。
stream 以后会遇到,(跟上传没什么关系)下载
velocity是与freemarker非常类似的另外一个模板框架,干不过freemarker了
xslt是与xml相关的修饰 修饰的xml语言
plaintext 将页面源码显示出来,做教学网站可能用到
tiles 将页面分为几块,每块可以自己动态指定现在基本不用
2.<global-results>设置可以是同包下的action共用,此属性可以通过extends继承其他包实现使用其
他包的<global-results>设置来使用
3.action中设置属性,方法中通过传递过来的值动态的给属性设置,在struts.xml中通过${属性名}方
式来得到属性具体值。此非el表达式。为ognl表达式
4.对于forward的action间会共享一个值栈,不用传递参数,一次request一个值栈。如果是redirect方
式则需要传递参数,传递参数不会在值栈中出现,但会在actioncontext中保存,所以可以通过从
actioncontext中取出的方式如:<s:property value="#parameters.参数名"/>
5.result总结:1.常用四种类型dispatcher,redirect,chain,redirectAction 2.全局结果集 global-
results|extends 3.动态结果(了解) 在action中保存一个属性,存储具体的结果location 4.传递参数
客户跳转才需传递 ${}表达式不是el
读doc文档,struts-tags
设计约定(编码规定)