zoukankan      html  css  js  c++  java
  • struts2 过滤器

    在struts.xml中,关于interceptor相关的节点定义如下:

    1.定义interceptor

    <interceptors>

    <interceptor name="autowiring"
    class="…xwork2.spring.interceptor.ActionAutowiringInterceptor"/>
    </interceptors>

    2.定于interceptor栈

    <interceptor-stack name="basicStack">
    <interceptor-ref name="exception"/>
    <interceptor-ref name="servlet-config"/>
    <interceptor-ref name="prepare"/>
    <interceptor-ref name="checkbox"/>
    <interceptor-ref name="params"/>
    <interceptor-ref name="conversionError"/>
    </interceptor-stack>

    3.定义默认interceptor

    <default-interceptor-ref name="autowiring"/>

    4.在action中使用interceptor

    <action name="my" class="com.fdar.infoq.MyAction" >
    <result>view.jsp</result>
    <interceptor-ref name="basicStack"/>
    </action>

  • 相关阅读:
    MSSQL
    Dapper
    Asynchronous Programming
    PHP on CentOS (LAMP) and wordpress
    CSS
    TypeScript & JavaScript
    AngularJS 2.0
    ReadMe.md MarkDown file
    shortcuts on Windows and MacOS
    移动平台的meta标签
  • 原文地址:https://www.cnblogs.com/kevinge/p/1880484.html
Copyright © 2011-2022 走看看