⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 struts 2的基石——拦截器(interceptor) - max on java - blogjava.mht

📁 MVC结构中struts的详细介绍
💻 MHT
📖 第 1 页 / 共 5 页
字号:
=E7=A4=BA=E3=80=82</P>
<P><IMG =
alt=3D=E5=9B=BE=EF=BC=91=E3=80=80=E6=8B=A6=E6=88=AA=E5=99=A8=E8=B0=83=E7=94=
=A8=E5=BA=8F=E5=88=97=E5=9B=BE=20
src=3D"http://www.blogjava.net/images/blogjava_net/max/18114/r_pic1.jpg">=
=20
<BR><SPAN style=3D"FONT-SIZE: smaller; FONT-STYLE: =
italic">=E5=9B=BE=EF=BC=91=E3=80=80=E6=8B=A6=E6=88=AA=E5=99=A8=E8=B0=83=E7=
=94=A8=E5=BA=8F=E5=88=97=E5=9B=BE</SPAN> </P>
<H2>=E5=B7=B2=E6=9C=89=E7=9A=84=E6=8B=A6=E6=88=AA=E5=99=A8</H2>
<P>Struts=20
2=E5=B7=B2=E7=BB=8F=E4=B8=BA=E6=82=A8=E6=8F=90=E4=BE=9B=E4=B8=B0=E5=AF=8C=
=E5=A4=9A=E6=A0=B7=E7=9A=84=EF=BC=8C=E5=8A=9F=E8=83=BD=E9=BD=90=E5=85=A8=E7=
=9A=84=E6=8B=A6=E6=88=AA=E5=99=A8=E5=AE=9E=E7=8E=B0=E3=80=82=E5=A4=A7=E5=AE=
=B6=E5=8F=AF=E4=BB=A5=E5=88=B0struts2-all-2.0.1.jar=E6=88=96struts2-core-=
2.0.1.jar=E5=8C=85=E7=9A=84struts-default.xml=E6=9F=A5=E7=9C=8B=E5=85=B3=E4=
=BA=8E=E9=BB=98=E8=AE=A4=E7=9A=84=E6=8B=A6=E6=88=AA=E5=99=A8=E4=B8=8E=E6=8B=
=A6=E6=88=AA=E5=99=A8=E9=93=BE=E7=9A=84=E9=85=8D=E7=BD=AE=E3=80=82</P>
<TABLE=20
style=3D"BORDER-RIGHT: #f0c000 1px solid; BORDER-TOP: #f0c000 1px solid; =
MARGIN-TOP: 8px; MARGIN-BOTTOM: 8px; BORDER-LEFT: #f0c000 1px solid; =
BORDER-BOTTOM: #f0c000 1px solid; BACKGROUND-COLOR: #ffffce; TEXT-ALIGN: =
left"=20
cellSpacing=3D0 cellPadding=3D0 border=3D0>
  <TBODY>
  <TR>
    <TD=20
    style=3D"PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 4px; =
PADDING-TOP: 4px"><IMG=20
      =
src=3D"http://cwiki.apache.org/confluence/images/icons/emoticons/lightbul=
b_on.gif">=20
    </TD>
    <TD=20
    style=3D"PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 4px; =
PADDING-TOP: 4px; FONT-FAMILY: =E9=BB=91=E4=BD=93, =E5=AE=8B=E4=BD=93, =
Tahoma, =
Arial">=E5=9C=A8=E6=9C=AC=E6=96=87=E4=BD=BF=E7=94=A8=E6=98=AFStruts=20
      =
2=E7=9A=84=E6=9C=80=E6=96=B0=E5=8F=91=E5=B8=83=E7=89=88=E6=9C=AC2.0.1=E3=80=
=82=E9=9C=80=E8=A6=81=E4=B8=8B=E8=BD=BD=E7=9A=84=E6=9C=8B=E5=8F=8B=E8=AF=B7=
=E7=82=B9=E5=87=BB=E4=BB=A5=E4=B8=8B=E9=93=BE=E6=8E=A5=EF=BC=9A<BR><A=20
      =
href=3D"http://apache.justdn.org/struts/binaries/struts-2.0.1-all.zip">ht=
tp://apache.justdn.org/struts/binaries/struts-2.0.1-all.zip</A></TD></TR>=
</TBODY></TABLE>
<P>=E4=BB=A5=E4=B8=8B=E9=83=A8=E5=88=86=E5=B0=B1=E6=98=AF=E4=BB=8Estruts-=
default.xml=E6=96=87=E4=BB=B6=E6=91=98=E5=8F=96=E7=9A=84=E5=86=85=E5=AE=B9=
=EF=BC=9A</P>
<DIV=20
style=3D"BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; =
BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; =
PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; =
WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px =
solid; BACKGROUND-COLOR: #eeeeee"><SPAN=20
style=3D"COLOR: #0000ff">&lt;</SPAN> <SPAN style=3D"COLOR: =
#800000">interceptor=20
</SPAN><SPAN style=3D"COLOR: #ff0000">name</SPAN> <SPAN=20
style=3D"COLOR: #0000ff">=3D"alias"</SPAN> <SPAN style=3D"COLOR: =
#ff0000">class</SPAN>=20
<SPAN=20
style=3D"COLOR: =
#0000ff">=3D"com.opensymphony.xwork2.interceptor.AliasInterceptor"</SPAN>=
=20
<SPAN style=3D"COLOR: #0000ff">/&gt;</SPAN> <SPAN=20
style=3D"COLOR: #000000"><BR></SPAN><SPAN style=3D"COLOR: =
#0000ff">&lt;</SPAN> <SPAN=20
style=3D"COLOR: #800000">interceptor </SPAN><SPAN=20
style=3D"COLOR: #ff0000">name</SPAN> <SPAN=20
style=3D"COLOR: #0000ff">=3D"autowiring"</SPAN> <SPAN=20
style=3D"COLOR: #ff0000">class</SPAN> <SPAN=20
style=3D"COLOR: =
#0000ff">=3D"com.opensymphony.xwork2.spring.interceptor.ActionAutowiringI=
nterceptor"</SPAN>=20
<SPAN style=3D"COLOR: #0000ff">/&gt;</SPAN> <SPAN=20
style=3D"COLOR: #000000"><BR></SPAN><SPAN style=3D"COLOR: =
#0000ff">&lt;</SPAN> <SPAN=20
style=3D"COLOR: #800000">interceptor </SPAN><SPAN=20
style=3D"COLOR: #ff0000">name</SPAN> <SPAN style=3D"COLOR: =
#0000ff">=3D"chain"</SPAN>=20
<SPAN style=3D"COLOR: #ff0000">class</SPAN> <SPAN=20
style=3D"COLOR: =
#0000ff">=3D"com.opensymphony.xwork2.interceptor.ChainingInterceptor"</SP=
AN>=20
<SPAN style=3D"COLOR: #0000ff">/&gt;</SPAN> <SPAN=20
style=3D"COLOR: #000000"><BR></SPAN><SPAN style=3D"COLOR: =
#0000ff">&lt;</SPAN> <SPAN=20
style=3D"COLOR: #800000">interceptor </SPAN><SPAN=20
style=3D"COLOR: #ff0000">name</SPAN> <SPAN=20
style=3D"COLOR: #0000ff">=3D"conversionError"</SPAN> <SPAN=20
style=3D"COLOR: #ff0000">class</SPAN> <SPAN=20
style=3D"COLOR: =
#0000ff">=3D"org.apache.struts2.interceptor.StrutsConversionErrorIntercep=
tor"</SPAN>=20
<SPAN style=3D"COLOR: #0000ff">/&gt;</SPAN> <SPAN=20
style=3D"COLOR: #000000"><BR></SPAN><SPAN style=3D"COLOR: =
#0000ff">&lt;</SPAN> <SPAN=20
style=3D"COLOR: #800000">interceptor </SPAN><SPAN=20
style=3D"COLOR: #ff0000">name</SPAN> <SPAN=20
style=3D"COLOR: #0000ff">=3D"createSession"</SPAN> <SPAN=20
style=3D"COLOR: #ff0000">class</SPAN> <SPAN=20
style=3D"COLOR: =
#0000ff">=3D"org.apache.struts2.interceptor.CreateSessionInterceptor"</SP=
AN>=20
<SPAN style=3D"COLOR: #ff0000"></SPAN><SPAN style=3D"COLOR: =
#0000ff">/&gt;</SPAN>=20
<SPAN style=3D"COLOR: #000000"><BR></SPAN><SPAN style=3D"COLOR: =
#0000ff">&lt;</SPAN>=20
<SPAN style=3D"COLOR: #800000">interceptor </SPAN><SPAN=20
style=3D"COLOR: #ff0000">name</SPAN> <SPAN=20
style=3D"COLOR: #0000ff">=3D"debugging"</SPAN> <SPAN=20
style=3D"COLOR: #ff0000">class</SPAN> <SPAN=20
style=3D"COLOR: =
#0000ff">=3D"org.apache.struts2.interceptor.debugging.DebuggingIntercepto=
r"</SPAN>=20
<SPAN style=3D"COLOR: #ff0000"></SPAN><SPAN style=3D"COLOR: =
#0000ff">/&gt;</SPAN>=20
<SPAN style=3D"COLOR: #000000"><BR></SPAN><SPAN style=3D"COLOR: =
#0000ff">&lt;</SPAN>=20
<SPAN style=3D"COLOR: #800000">interceptor </SPAN><SPAN=20
style=3D"COLOR: #ff0000">name</SPAN> <SPAN=20
style=3D"COLOR: #0000ff">=3D"external-ref"</SPAN> <SPAN=20
style=3D"COLOR: #ff0000">class</SPAN> <SPAN=20
style=3D"COLOR: =
#0000ff">=3D"com.opensymphony.xwork2.interceptor.ExternalReferencesInterc=
eptor"</SPAN>=20
<SPAN style=3D"COLOR: #0000ff">/&gt;</SPAN> <SPAN=20
style=3D"COLOR: #000000"><BR></SPAN><SPAN style=3D"COLOR: =
#0000ff">&lt;</SPAN> <SPAN=20
style=3D"COLOR: #800000">interceptor </SPAN><SPAN=20
style=3D"COLOR: #ff0000">name</SPAN> <SPAN=20
style=3D"COLOR: #0000ff">=3D"execAndWait"</SPAN> <SPAN=20
style=3D"COLOR: #ff0000">class</SPAN> <SPAN=20
style=3D"COLOR: =
#0000ff">=3D"org.apache.struts2.interceptor.ExecuteAndWaitInterceptor"</S=
PAN>=20
<SPAN style=3D"COLOR: #0000ff">/&gt;</SPAN> <SPAN=20
style=3D"COLOR: #000000"><BR></SPAN><SPAN style=3D"COLOR: =
#0000ff">&lt;</SPAN> <SPAN=20
style=3D"COLOR: #800000">interceptor </SPAN><SPAN=20
style=3D"COLOR: #ff0000">name</SPAN> <SPAN=20
style=3D"COLOR: #0000ff">=3D"exception"</SPAN> <SPAN=20
style=3D"COLOR: #ff0000">class</SPAN> <SPAN=20
style=3D"COLOR: =
#0000ff">=3D"com.opensymphony.xwork2.interceptor.ExceptionMappingIntercep=
tor"</SPAN>=20
<SPAN style=3D"COLOR: #0000ff">/&gt;</SPAN> <SPAN=20
style=3D"COLOR: #000000"><BR></SPAN><SPAN style=3D"COLOR: =
#0000ff">&lt;</SPAN> <SPAN=20
style=3D"COLOR: #800000">interceptor </SPAN><SPAN=20
style=3D"COLOR: #ff0000">name</SPAN> <SPAN=20
style=3D"COLOR: #0000ff">=3D"fileUpload"</SPAN> <SPAN=20
style=3D"COLOR: #ff0000">class</SPAN> <SPAN=20
style=3D"COLOR: =
#0000ff">=3D"org.apache.struts2.interceptor.FileUploadInterceptor"</SPAN>=
=20
<SPAN style=3D"COLOR: #0000ff">/&gt;</SPAN> <SPAN=20
style=3D"COLOR: #000000"><BR></SPAN><SPAN style=3D"COLOR: =
#0000ff">&lt;</SPAN> <SPAN=20
style=3D"COLOR: #800000">interceptor </SPAN><SPAN=20
style=3D"COLOR: #ff0000">name</SPAN> <SPAN style=3D"COLOR: =
#0000ff">=3D"i18n"</SPAN>=20
<SPAN style=3D"COLOR: #ff0000">class</SPAN> <SPAN=20
style=3D"COLOR: =
#0000ff">=3D"com.opensymphony.xwork2.interceptor.I18nInterceptor"</SPAN> =

<SPAN style=3D"COLOR: #0000ff">/&gt;</SPAN> <SPAN=20
style=3D"COLOR: #000000"><BR></SPAN><SPAN style=3D"COLOR: =
#0000ff">&lt;</SPAN> <SPAN=20
style=3D"COLOR: #800000">interceptor </SPAN><SPAN=20
style=3D"COLOR: #ff0000">name</SPAN> <SPAN style=3D"COLOR: =
#0000ff">=3D"logger"</SPAN>=20
<SPAN style=3D"COLOR: #ff0000">class</SPAN> <SPAN=20
style=3D"COLOR: =
#0000ff">=3D"com.opensymphony.xwork2.interceptor.LoggingInterceptor"</SPA=
N>=20
<SPAN style=3D"COLOR: #0000ff">/&gt;</SPAN> <SPAN=20
style=3D"COLOR: #000000"><BR></SPAN><SPAN style=3D"COLOR: =
#0000ff">&lt;</SPAN> <SPAN=20
style=3D"COLOR: #800000">interceptor </SPAN><SPAN=20
style=3D"COLOR: #ff0000">name</SPAN> <SPAN=20
style=3D"COLOR: #0000ff">=3D"model-driven"</SPAN> <SPAN=20
style=3D"COLOR: #ff0000">class</SPAN> <SPAN=20
style=3D"COLOR: =
#0000ff">=3D"com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor"<=
/SPAN>=20
<SPAN style=3D"COLOR: #0000ff">/&gt;</SPAN> <SPAN=20
style=3D"COLOR: #000000"><BR></SPAN><SPAN style=3D"COLOR: =
#0000ff">&lt;</SPAN> <SPAN=20
style=3D"COLOR: #800000">interceptor </SPAN><SPAN=20
style=3D"COLOR: #ff0000">name</SPAN> <SPAN=20
style=3D"COLOR: #0000ff">=3D"scoped-model-driven"</SPAN> <SPAN=20
style=3D"COLOR: #ff0000">class</SPAN> <SPAN=20
style=3D"COLOR: =
#0000ff">=3D"com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterce=
ptor"</SPAN>=20
<SPAN style=3D"COLOR: #0000ff">/&gt;</SPAN> <SPAN=20
style=3D"COLOR: #000000"><BR></SPAN><SPAN style=3D"COLOR: =
#0000ff">&lt;</SPAN> <SPAN=20
style=3D"COLOR: #800000">interceptor </SPAN><SPAN=20
style=3D"COLOR: #ff0000">name</SPAN> <SPAN style=3D"COLOR: =
#0000ff">=3D"params"</SPAN>=20
<SPAN style=3D"COLOR: #ff0000">class</SPAN> <SPAN=20
style=3D"COLOR: =
#0000ff">=3D"com.opensymphony.xwork2.interceptor.ParametersInterceptor"</=
SPAN>=20
<SPAN style=3D"COLOR: #0000ff">/&gt;</SPAN> <SPAN=20
style=3D"COLOR: #000000"><BR></SPAN><SPAN style=3D"COLOR: =
#0000ff">&lt;</SPAN> <SPAN=20
style=3D"COLOR: #800000">interceptor </SPAN><SPAN=20
style=3D"COLOR: #ff0000">name</SPAN> <SPAN=20
style=3D"COLOR: #0000ff">=3D"prepare"</SPAN> <SPAN=20
style=3D"COLOR: #ff0000">class</SPAN> <SPAN=20
style=3D"COLOR: =
#0000ff">=3D"com.opensymphony.xwork2.interceptor.PrepareInterceptor"</SPA=
N>=20
<SPAN style=3D"COLOR: #0000ff">/&gt;</SPAN> <SPAN=20
style=3D"COLOR: #000000"><BR></SPAN><SPAN style=3D"COLOR: =
#0000ff">&lt;</SPAN> <SPAN=20
style=3D"COLOR: #800000">interceptor </SPAN><SPAN=20
style=3D"COLOR: #ff0000">name</SPAN> <SPAN=20
style=3D"COLOR: #0000ff">=3D"static-params"</SPAN> <SPAN=20
style=3D"COLOR: #ff0000">class</SPAN> <SPAN=20
style=3D"COLOR: =
#0000ff">=3D"com.opensymphony.xwork2.interceptor.StaticParametersIntercep=
tor"</SPAN>=20
<SPAN style=3D"COLOR: #0000ff">/&gt;</SPAN> <SPAN=20
style=3D"COLOR: #000000"><BR></SPAN><SPAN style=3D"COLOR: =
#0000ff">&lt;</SPAN> <SPAN=20
style=3D"COLOR: #800000">interceptor </SPAN><SPAN=20
style=3D"COLOR: #ff0000">name</SPAN> <SPAN style=3D"COLOR: =
#0000ff">=3D"scope"</SPAN>=20
<SPAN style=3D"COLOR: #ff0000">class</SPAN> <SPAN=20
style=3D"COLOR: =
#0000ff">=3D"org.apache.struts2.interceptor.ScopeInterceptor"</SPAN>=20
<SPAN style=3D"COLOR: #0000ff">/&gt;</SPAN> <SPAN=20
style=3D"COLOR: #000000"><BR></SPAN><SPAN style=3D"COLOR: =
#0000ff">&lt;</SPAN> <SPAN=20
style=3D"COLOR: #800000">interceptor </SPAN><SPAN=20
style=3D"COLOR: #ff0000">name</SPAN> <SPAN=20
style=3D"COLOR: #0000ff">=3D"servlet-config"</SPAN> <SPAN=20
style=3D"COLOR: #ff0000">class</SPAN> <SPAN=20
style=3D"COLOR: =
#0000ff">=3D"org.apache.struts2.interceptor.ServletConfigInterceptor"</SP=
AN>=20
<SPAN style=3D"COLOR: #0000ff">/&gt;</SPAN> <SPAN=20
style=3D"COLOR: #000000"><BR></SPAN><SPAN style=3D"COLOR: =
#0000ff">&lt;</SPAN> <SPAN=20
style=3D"COLOR: #800000">interceptor </SPAN><SPAN=20
style=3D"COLOR: #ff0000">name</SPAN> <SPAN=20
style=3D"COLOR: #0000ff">=3D"sessionAutowiring"</SPAN> <SPAN=20
style=3D"COLOR: #ff0000">class</SPAN> <SPAN=20
style=3D"COLOR: =
#0000ff">=3D"org.apache.struts2.spring.interceptor.SessionContextAutowiri=
ngInterceptor"</SPAN>=20
<SPAN style=3D"COLOR: #0000ff">/&gt;</SPAN> <SPAN=20
style=3D"COLOR: #000000"><BR></SPAN><SPAN style=3D"COLOR: =
#0000ff">&lt;</SPAN> <SPAN=20

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -