<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    Junky's IT Notebook

    統(tǒng)計(jì)

    留言簿(8)

    積分與排名

    WebSphere Studio

    閱讀排行榜

    評(píng)論排行榜

    Strust攔截器

    1.概述

    Strust攔截器改進(jìn)了Strust對(duì)Action的操作能力,增加了攔截器特性和IoC特性.

    通過分析另外的WEB框架,比如:WebWork 2/XWork,Strust攔截器的目的是把其它WEB框架最好的特性整合到STRUTS中.Strust攔截器支持struts1.1, 按照BSD許可發(fā)行.

    2.特點(diǎn)
    Action 攔截
    WW2 操作風(fēng)格
    支持 regular 和 Tiles
    包括使用Strust攔截器修改過的Strust例子


    3.使用方法:

    把Strust攔截器配置為一個(gè)struts插件,就可以在需要的任何地方調(diào)用.


    4.配置struts插件:

    把Strust攔截器配置為一個(gè)struts插件,只需要修改 Struts 配置文件就可以了,修改后的配置文件.一般看起來像這種樣子:

    <plug-in className="net.sf.struts.saif.SAIFPlugin">
    <set-property property="interceptor-config" value="/WEB-INF/interceptor-config.xml" />
    </plug-in>


    5.攔截器的配置

    在interceptor-config.xml文件中定義了所有攔截(當(dāng)然可以是另外的任何文件名). 這個(gè)文件包含攔截定義和它們應(yīng)該如何被使用.

    從兩個(gè)方面來定義 Struts Actions攔截:
    globally and by Action. When the Action is requested, first any global interceptors will be applied, then Action-specific interceptors.

    The following interceptors are included in SAIF:

    Included interceptors Class Description
    net.sf.struts.saif.ComponentInterceptor Performs inversion of control functionality. Sets any components the Action has defined it needs.

    This is an example of an interceptor configuration file:

    <interceptor-config>
    <interceptor name="componentInterceptor" type="net.sf.struts.saif.ComponentInterceptor"/>
    <interceptor name="testInterceptor" type="net.sf.struts.saif.TestInterceptor"/>

    <default-interceptors>
    <interceptor name="componentInterceptor"/>
    </default-interceptors>

    <action type="org.apache.struts.webapp.example.EditRegistrationAction">
    <interceptor name="testInterceptor"/>
    </action>
    </interceptor-config>
    Interceptor Implementation
    Interceptors can perform actions before and after a Struts Action is called. To write an interceptor, simple implement the net.sf.struts.saif.ActionInterceptor interface and implement the beforeAction() and afterAction() methods.

    This is an example of an interceptor implementation:

    public class TestInterceptor implements ActionInterceptor
    {
    public void beforeAction(Action action, ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
    {
    log.debug("beforeAction called");
    }

    public void afterAction(Action action, ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
    {
    log.debug("afterAction called");
    }

    private Log log = LogFactory.getLog(TestInterceptor.class);
    }
    Contact
    Please contact Lars Hoss or Don Brown with comments, bug reports, and suggestions.

    posted on 2007-06-28 09:35 junky 閱讀(726) 評(píng)論(0)  編輯  收藏 所屬分類: struts

    主站蜘蛛池模板: 大地资源免费更新在线播放| 人人爽人人爽人人片av免费| 男人的天堂网免费网站| 国产成人毛片亚洲精品| 免费一级全黄少妇性色生活片 | 精品亚洲国产成AV人片传媒| 国精产品一区一区三区免费视频| 亚洲免费日韩无码系列 | 成年女人毛片免费观看97| 亚洲中文字幕无码久久2020| 最近2019中文字幕免费看最新| 亚洲日韩久久综合中文字幕| 白白国产永久免费视频| 免费精品国自产拍在线播放| 国产亚洲情侣一区二区无码AV| 在线观看免费黄网站| 图图资源网亚洲综合网站| 久久精品免费一区二区| 亚洲欧美不卡高清在线| 免费在线观看黄网站| 日韩a级无码免费视频| 日韩亚洲AV无码一区二区不卡| 青青青免费国产在线视频小草| 久久亚洲精品国产亚洲老地址| 日韩a在线观看免费观看| 阿v视频免费在线观看| 亚洲人成精品久久久久| 69影院毛片免费观看视频在线| 91亚洲视频在线观看| 在线观着免费观看国产黄| 国产精品高清免费网站| 亚洲精品熟女国产| 国产午夜鲁丝片AV无码免费| a级毛片高清免费视频就| 亚洲剧情在线观看| 免费成人黄色大片| 亚洲无砖砖区免费| 阿v免费在线观看| 亚洲国产成AV人天堂无码| 亚洲成年看片在线观看| 91精品导航在线网址免费|