阅读背景:

java中的拦截器

来源:互联网 

应用拦阻器断定用户是不是登录与是不是登录超时,struts2中

1.struts中的配置

		<interceptors>
			<!--  声明拦阻器 --> 
			<interceptor name="logInterceptor" class="com.oa.util.LogInterceptor"></interceptor>
			<!--  配置新的拦阻器栈  -->
			<interceptor-stack name="myStack">
				<interceptor-ref name="logInterceptor">
				</interceptor-ref>
				<!-- 引入defaultStack -->
				<!-- 全局的每一个action都会拦阻 -->  
			    <interceptor-ref name="defaultStack"></interceptor-ref>
			</interceptor-stack>
		</interceptors>
		<global-results>
			<result name="logout" type="redirect">/jsp/login.jsp</result>
		</global-results>
		<action name="*_*"  class="{1}Action" method="{2}">
			<!-- 应用拦阻器 -->
			<interceptor-ref name="myStack"></interceptor-ref>
			<result name="success">/jsp/{1}/{1}_{2}.jsp</result>
		</action>		<in




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: