1
2
3
4
5
6
7
8
9
10
11
12
|
<
package
name=
"my"
extends
=
"struts-default"
namespace=
"/manage"
>
<interceptors>
<!-- 定義攔截器 -->
<interceptor name=
"攔截器名"
class
=
"攔截器實現類"
/>
<!-- 定義攔截器棧 -->
<interceptor-stack name=
"攔截器棧名"
>
<interceptor-ref name=
"攔截器一"
/>
<interceptor-ref name=
"攔截器二"
/>
</interceptor-stack>
</interceptors>
......
</
package
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
<result-types>
<result-type name=
"chain"
class
=
"com.opensymphony.xwork2.ActionChainResult"
/>
<result-type name=
"dispatcher"
class
=
"org.apache.struts2.dispatcher.ServletDispatcherResult"
default
=
"true"
/>
<result-type name=
"freemarker"
class
=
"org.apache.struts2.views.freemarker.FreemarkerResult"
/>
<result-type name=
"httpheader"
class
=
"org.apache.struts2.dispatcher.HttpHeaderResult"
/>
<result-type name=
"redirect"
class
=
"org.apache.struts2.dispatcher.ServletRedirectResult"
/>
<result-type name=
"redirectAction"
class
=
"org.apache.struts2.dispatcher.ServletActionRedirectResult"
/>
<result-type name=
"stream"
class
=
"org.apache.struts2.dispatcher.StreamResult"
/>
<result-type name=
"velocity"
class
=
"org.apache.struts2.dispatcher.VelocityResult"
/>
<result-type name=
"xslt"
class
=
"org.apache.struts2.views.xslt.XSLTResult"
/>
<result-type name=
"plainText"
class
=
"org.apache.struts2.dispatcher.PlainTextResult"
/>
<!-- Deprecated name form scheduled
for
removal in Struts
2.1
.
0
. The camelCase versions are preferred. See ww-
1707
-->
<result-type name=
"redirect-action"
class
=
"org.apache.struts2.dispatcher.ServletActionRedirectResult"
/>
<result-type name=
"plaintext"
class
=
"org.apache.struts2.dispatcher.PlainTextResult"
/>
</result-types>
|
1
|
org.apache.struts2.dispatcher.ServletDispatcherResult
|
1
|
org.apache.struts2.views.freemarker.FreemarkerResult
|
1
|
org.apache.struts2.dispatcher.HttpHeaderResult
|
1
|
org.apache.struts2.dispatcher.StreamResult
|
1
2
3
4
5
6
|
<result name=
"success"
type=
"stream"
>
<param name=
"contentType"
>image/jpeg</param>
<param name=
"inputName"
>imageStream</param>
<param name=
"contentDisposition"
>filename=
"document.pdf"
</param>
<param name=
"bufferSize"
>
1024
</param>
</result>
|
1
|
org.apache.struts2.dispatcher.VelocityResult
|
1
|
org.apache.struts2.views.xslt.XSLTResult
|
1
|
org.apache.struts2.dispatcher.PlainTextResult
|
1
|
com.opensymphony.xwork2.ActionChainResult
|
1
|
org.apache.struts2.dispatcher.ServletRedirectResult
|
1
|
org.apache.struts2.dispatcher.ServletActionRedirectResult
|
1
2
3
|
<action name=
"Login"
class
=
"steven.actions.LoginAction"
>
<result name=
"success"
type=
"redirectAction"
>User?u_id=${loginBean.u_id}</result>
</action>
|
1
2
3
|
<action name=
"Login"
class
=
"steven.actions.LoginAction"
>
<result name=
"success"
type=
"redirect"
>User.action?u_id=${loginBean.u_id}</result>
</action>
|