<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

    主站蜘蛛池模板: 亚洲国产精品xo在线观看| 亚洲性色AV日韩在线观看| a毛看片免费观看视频| 亚洲精品色在线网站| 一级做a爰片性色毛片免费网站| 一区二区在线视频免费观看| 国产精品午夜免费观看网站| 50岁老女人的毛片免费观看| 国产一区在线观看免费| 国产亚洲精品影视在线产品| 亚洲美女自拍视频| 成在线人直播免费视频| 全黄A免费一级毛片| 最近最新MV在线观看免费高清| 热久久精品免费视频| 亚洲AV无码成人精品区天堂 | 亚洲国产精品热久久| 亚洲色成人网站WWW永久四虎| 精品熟女少妇av免费久久| 国产性爱在线观看亚洲黄色一级片| 亚洲男人天堂2018av| 野花香在线视频免费观看大全| 香蕉视频在线免费看| 成人av免费电影| 亚洲日本va午夜中文字幕一区| 在线观看亚洲成人| 日韩亚洲国产高清免费视频| 成年女人看片免费视频播放器| 亚洲性久久久影院| 日日摸日日碰夜夜爽亚洲| 插B内射18免费视频| 亚洲爆乳无码精品AAA片蜜桃| 国产免费不卡v片在线观看| 亚洲精选在线观看| 91高清免费国产自产| 亚洲av日韩av无码黑人| 久久久国产亚洲精品| 在线成人a毛片免费播放| 亚洲国产中文在线二区三区免| 成人免费a级毛片| 久久亚洲AV成人无码国产最大|