struts2.0中struts.xml配置文件详解

DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd" >

<struts>

<include file="struts-default.xml">include>

<package name="com.kay.struts2" extends="struts-default" namespace="/test">        <interceptors>

            

            <interceptor name="timer" class="com.kay.timer">interceptor>                       <interceptor name="logger" class="com.kay.logger">interceptor>                     

<interceptor-stack name="mystack">

<interceptor-ref name="timer">interceptor-ref>

<interceptor-ref name="logger">interceptor-ref>

interceptor-stack>

interceptors>

<-- 

定义默认的拦截器 每个Action都会自动引用,如果Action中引用了其它的拦截器 默认的拦截器将无效 

-->

<default-interceptor-ref name="mystack">default-interceptor-ref>

<global-results>

       <result name="input">/error.jspresult>

global-results>

<action name="hello" class="com.kay.struts2.Action.LoginAction">

      <interceptor-ref name="timer">interceptor-ref>

     

     <result name="success" type="dispatcher">/talk.jspresult>

         

         <param name="url">http://www.sina.comparam>

action>

package>

struts>

 

 

你可能感兴趣的:(框架_Struts2,struts,action,class,timer,扩展,include)