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

来自「struts2标签的详细解释说明教程」· HTM 代码 · 共 838 行 · 第 1/5 页

HTM
838 行
字号
<SPAN style="COLOR: #0000ff">/&gt;</SPAN> <SPAN 
style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN> <SPAN 
style="COLOR: #800000">interceptor </SPAN><SPAN 
style="COLOR: #ff0000">name</SPAN> <SPAN 
style="COLOR: #0000ff">="conversionError"</SPAN> <SPAN 
style="COLOR: #ff0000">class</SPAN> <SPAN 
style="COLOR: #0000ff">="org.apache.struts2.interceptor.StrutsConversionErrorInterceptor"</SPAN> 
<SPAN style="COLOR: #0000ff">/&gt;</SPAN> <SPAN 
style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN> <SPAN 
style="COLOR: #800000">interceptor </SPAN><SPAN 
style="COLOR: #ff0000">name</SPAN> <SPAN 
style="COLOR: #0000ff">="createSession"</SPAN> <SPAN 
style="COLOR: #ff0000">class</SPAN> <SPAN 
style="COLOR: #0000ff">="org.apache.struts2.interceptor.CreateSessionInterceptor"</SPAN> 
<SPAN style="COLOR: #ff0000"></SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN> 
<SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN> 
<SPAN style="COLOR: #800000">interceptor </SPAN><SPAN 
style="COLOR: #ff0000">name</SPAN> <SPAN 
style="COLOR: #0000ff">="debugging"</SPAN> <SPAN 
style="COLOR: #ff0000">class</SPAN> <SPAN 
style="COLOR: #0000ff">="org.apache.struts2.interceptor.debugging.DebuggingInterceptor"</SPAN> 
<SPAN style="COLOR: #ff0000"></SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN> 
<SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN> 
<SPAN style="COLOR: #800000">interceptor </SPAN><SPAN 
style="COLOR: #ff0000">name</SPAN> <SPAN 
style="COLOR: #0000ff">="external-ref"</SPAN> <SPAN 
style="COLOR: #ff0000">class</SPAN> <SPAN 
style="COLOR: #0000ff">="com.opensymphony.xwork2.interceptor.ExternalReferencesInterceptor"</SPAN> 
<SPAN style="COLOR: #0000ff">/&gt;</SPAN> <SPAN 
style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN> <SPAN 
style="COLOR: #800000">interceptor </SPAN><SPAN 
style="COLOR: #ff0000">name</SPAN> <SPAN 
style="COLOR: #0000ff">="execAndWait"</SPAN> <SPAN 
style="COLOR: #ff0000">class</SPAN> <SPAN 
style="COLOR: #0000ff">="org.apache.struts2.interceptor.ExecuteAndWaitInterceptor"</SPAN> 
<SPAN style="COLOR: #0000ff">/&gt;</SPAN> <SPAN 
style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN> <SPAN 
style="COLOR: #800000">interceptor </SPAN><SPAN 
style="COLOR: #ff0000">name</SPAN> <SPAN 
style="COLOR: #0000ff">="exception"</SPAN> <SPAN 
style="COLOR: #ff0000">class</SPAN> <SPAN 
style="COLOR: #0000ff">="com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor"</SPAN> 
<SPAN style="COLOR: #0000ff">/&gt;</SPAN> <SPAN 
style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN> <SPAN 
style="COLOR: #800000">interceptor </SPAN><SPAN 
style="COLOR: #ff0000">name</SPAN> <SPAN 
style="COLOR: #0000ff">="fileUpload"</SPAN> <SPAN 
style="COLOR: #ff0000">class</SPAN> <SPAN 
style="COLOR: #0000ff">="org.apache.struts2.interceptor.FileUploadInterceptor"</SPAN> 
<SPAN style="COLOR: #0000ff">/&gt;</SPAN> <SPAN 
style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN> <SPAN 
style="COLOR: #800000">interceptor </SPAN><SPAN 
style="COLOR: #ff0000">name</SPAN> <SPAN style="COLOR: #0000ff">="i18n"</SPAN> 
<SPAN style="COLOR: #ff0000">class</SPAN> <SPAN 
style="COLOR: #0000ff">="com.opensymphony.xwork2.interceptor.I18nInterceptor"</SPAN> 
<SPAN style="COLOR: #0000ff">/&gt;</SPAN> <SPAN 
style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN> <SPAN 
style="COLOR: #800000">interceptor </SPAN><SPAN 
style="COLOR: #ff0000">name</SPAN> <SPAN style="COLOR: #0000ff">="logger"</SPAN> 
<SPAN style="COLOR: #ff0000">class</SPAN> <SPAN 
style="COLOR: #0000ff">="com.opensymphony.xwork2.interceptor.LoggingInterceptor"</SPAN> 
<SPAN style="COLOR: #0000ff">/&gt;</SPAN> <SPAN 
style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN> <SPAN 
style="COLOR: #800000">interceptor </SPAN><SPAN 
style="COLOR: #ff0000">name</SPAN> <SPAN 
style="COLOR: #0000ff">="model-driven"</SPAN> <SPAN 
style="COLOR: #ff0000">class</SPAN> <SPAN 
style="COLOR: #0000ff">="com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor"</SPAN> 
<SPAN style="COLOR: #0000ff">/&gt;</SPAN> <SPAN 
style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN> <SPAN 
style="COLOR: #800000">interceptor </SPAN><SPAN 
style="COLOR: #ff0000">name</SPAN> <SPAN 
style="COLOR: #0000ff">="scoped-model-driven"</SPAN> <SPAN 
style="COLOR: #ff0000">class</SPAN> <SPAN 
style="COLOR: #0000ff">="com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor"</SPAN> 
<SPAN style="COLOR: #0000ff">/&gt;</SPAN> <SPAN 
style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN> <SPAN 
style="COLOR: #800000">interceptor </SPAN><SPAN 
style="COLOR: #ff0000">name</SPAN> <SPAN style="COLOR: #0000ff">="params"</SPAN> 
<SPAN style="COLOR: #ff0000">class</SPAN> <SPAN 
style="COLOR: #0000ff">="com.opensymphony.xwork2.interceptor.ParametersInterceptor"</SPAN> 
<SPAN style="COLOR: #0000ff">/&gt;</SPAN> <SPAN 
style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN> <SPAN 
style="COLOR: #800000">interceptor </SPAN><SPAN 
style="COLOR: #ff0000">name</SPAN> <SPAN 
style="COLOR: #0000ff">="prepare"</SPAN> <SPAN 
style="COLOR: #ff0000">class</SPAN> <SPAN 
style="COLOR: #0000ff">="com.opensymphony.xwork2.interceptor.PrepareInterceptor"</SPAN> 
<SPAN style="COLOR: #0000ff">/&gt;</SPAN> <SPAN 
style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN> <SPAN 
style="COLOR: #800000">interceptor </SPAN><SPAN 
style="COLOR: #ff0000">name</SPAN> <SPAN 
style="COLOR: #0000ff">="static-params"</SPAN> <SPAN 
style="COLOR: #ff0000">class</SPAN> <SPAN 
style="COLOR: #0000ff">="com.opensymphony.xwork2.interceptor.StaticParametersInterceptor"</SPAN> 
<SPAN style="COLOR: #0000ff">/&gt;</SPAN> <SPAN 
style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN> <SPAN 
style="COLOR: #800000">interceptor </SPAN><SPAN 
style="COLOR: #ff0000">name</SPAN> <SPAN style="COLOR: #0000ff">="scope"</SPAN> 
<SPAN style="COLOR: #ff0000">class</SPAN> <SPAN 
style="COLOR: #0000ff">="org.apache.struts2.interceptor.ScopeInterceptor"</SPAN> 
<SPAN style="COLOR: #0000ff">/&gt;</SPAN> <SPAN 
style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN> <SPAN 
style="COLOR: #800000">interceptor </SPAN><SPAN 
style="COLOR: #ff0000">name</SPAN> <SPAN 
style="COLOR: #0000ff">="servlet-config"</SPAN> <SPAN 
style="COLOR: #ff0000">class</SPAN> <SPAN 
style="COLOR: #0000ff">="org.apache.struts2.interceptor.ServletConfigInterceptor"</SPAN> 
<SPAN style="COLOR: #0000ff">/&gt;</SPAN> <SPAN 
style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN> <SPAN 
style="COLOR: #800000">interceptor </SPAN><SPAN 
style="COLOR: #ff0000">name</SPAN> <SPAN 
style="COLOR: #0000ff">="sessionAutowiring"</SPAN> <SPAN 
style="COLOR: #ff0000">class</SPAN> <SPAN 
style="COLOR: #0000ff">="org.apache.struts2.spring.interceptor.SessionContextAutowiringInterceptor"</SPAN> 
<SPAN style="COLOR: #0000ff">/&gt;</SPAN> <SPAN 
style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN> <SPAN 
style="COLOR: #800000">interceptor </SPAN><SPAN 
style="COLOR: #ff0000">name</SPAN> <SPAN style="COLOR: #0000ff">="timer"</SPAN> 
<SPAN style="COLOR: #ff0000">class</SPAN> <SPAN 
style="COLOR: #0000ff">="com.opensymphony.xwork2.interceptor.TimerInterceptor"</SPAN> 
<SPAN style="COLOR: #0000ff">/&gt;</SPAN> <SPAN 
style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN> <SPAN 
style="COLOR: #800000">interceptor </SPAN><SPAN 
style="COLOR: #ff0000">name</SPAN> <SPAN style="COLOR: #0000ff">="token"</SPAN> 
<SPAN style="COLOR: #ff0000">class</SPAN> <SPAN 
style="COLOR: #0000ff">="org.apache.struts2.interceptor.TokenInterceptor"</SPAN> 
<SPAN style="COLOR: #0000ff">/&gt;</SPAN> <SPAN 
style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN> <SPAN 
style="COLOR: #800000">interceptor </SPAN><SPAN 
style="COLOR: #ff0000">name</SPAN> <SPAN 
style="COLOR: #0000ff">="token-session"</SPAN> <SPAN 
style="COLOR: #ff0000">class</SPAN> <SPAN 
style="COLOR: #0000ff">="org.apache.struts2.interceptor.TokenSessionStoreInterceptor"</SPAN> 
<SPAN style="COLOR: #0000ff">/&gt;</SPAN> <SPAN 
style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN> <SPAN 
style="COLOR: #800000">interceptor </SPAN><SPAN 
style="COLOR: #ff0000">name</SPAN> <SPAN 
style="COLOR: #0000ff">="validation"</SPAN> <SPAN 
style="COLOR: #ff0000">class</SPAN> <SPAN 
style="COLOR: #0000ff">="com.opensymphony.xwork2.validator.ValidationInterceptor"</SPAN> 
<SPAN style="COLOR: #0000ff">/&gt;</SPAN> <SPAN 
style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN> <SPAN 
style="COLOR: #800000">interceptor </SPAN><SPAN 
style="COLOR: #ff0000">name</SPAN> <SPAN 
style="COLOR: #0000ff">="workflow"</SPAN> <SPAN 
style="COLOR: #ff0000">class</SPAN> <SPAN 
style="COLOR: #0000ff">="com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor"</SPAN> 
<SPAN style="COLOR: #0000ff">/&gt;</SPAN> <SPAN 
style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN> <SPAN 
style="COLOR: #800000">interceptor </SPAN><SPAN 
style="COLOR: #ff0000">name</SPAN> <SPAN style="COLOR: #0000ff">="store"</SPAN> 
<SPAN style="COLOR: #ff0000">class</SPAN> <SPAN 
style="COLOR: #0000ff">="org.apache.struts2.interceptor.MessageStoreInterceptor"</SPAN> 
<SPAN style="COLOR: #ff0000"></SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN> 
<SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN> 
<SPAN style="COLOR: #800000">interceptor </SPAN><SPAN 
style="COLOR: #ff0000">name</SPAN> <SPAN 
style="COLOR: #0000ff">="checkbox"</SPAN> <SPAN 
style="COLOR: #ff0000">class</SPAN> <SPAN 
style="COLOR: #0000ff">="org.apache.struts2.interceptor.CheckboxInterceptor"</SPAN> 
<SPAN style="COLOR: #ff0000"></SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN> 
<SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN> 
<SPAN style="COLOR: #800000">interceptor </SPAN><SPAN 
style="COLOR: #ff0000">name</SPAN> <SPAN 
style="COLOR: #0000ff">="profiling"</SPAN> <SPAN 
style="COLOR: #ff0000">class</SPAN> <SPAN 
style="COLOR: #0000ff">="org.apache.struts2.interceptor.ProfilingActivationInterceptor"</SPAN> 

⌨️ 快捷键说明

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