日期:2014-05-17 浏览次数:20797 次
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd"> <struts> <package name="sshdefault" extends="convention-default" > <interceptors> <interceptor name="sessionout" class="com.easy.interceptor.SessionInterceptor" /> <interceptor-stack name="mydefaultStack"> <interceptor-ref name="sessionout" /> <interceptor-ref name="autowiring" /> <interceptor-ref name="paramsPrepareParamsStack" /> </interceptor-stack> </interceptors> <default-interceptor-ref name="mydefaultStack" /> <global-results> <result name="login">/index.jsp</result> </global-results> </package> </struts>
struts.action.extension=do,action struts.devMode=true struts.ui.theme=simple struts.multipart.maxSize=1073741824 struts.custom.i18n.resources=message struts.i18n.encoding=UTF-8 struts.convention.default.parent.package=sshdefault struts.convention.result.path=/WEB-INF/jsp/ struts.convention.action.packages=com.easy.action struts.convention.action.disableJarScanning=true struts.objectFactory=spring
package com.easy.interceptor; import com.opensymphony.xwork2.Action; import com.opensymphony.xwork2.ActionInvocation; import com.opensymphony.xwork2.interceptor.AbstractInterceptor; public class SessionInterceptor extends AbstractInterceptor { public String intercept(ActionInvocation invocation) throws Exception { Action action = (Action) invocation.getAction(); System.out.println(action.getClass().getName()); return Action.LOGIN; } }