美文网首页struts2
struts2+拦截器

struts2+拦截器

作者: simple_no1 | 来源:发表于2016-07-09 02:42 被阅读30次

1,定义一个拦截器类继承 AbstractInterceptor  或者 MethodFilterInterceptor
2.在struts.xml里面定义如下

  <interceptors>

    <interceptor name="encodingInterceptor"class="sy.interceptor.EncodingInterceptor">

    <interceptor-stack name="encodingStack">

    <interceptor-ref name="defaultStack"></interceptor>

  <interceptor-ref name="encodingInterceptor"></interceptor>

    </interceptor-stack>

</interceptor>

</interceptors>

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

相关文章

网友评论

    本文标题:struts2+拦截器

    本文链接:https://www.haomeiwen.com/subject/dnprjttx.html