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

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

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

    Sealyu

    --- 博客已遷移至: http://www.sealyu.com/blog

      BlogJava :: 首頁(yè) :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::
      618 隨筆 :: 87 文章 :: 225 評(píng)論 :: 0 Trackbacks

    Recently i while doing a R&D sort of thing on my ide’s (eclipse and netbeans) i encountered on a struts 2 application.I read its documentation on the page and decided to give it a try as i went through the features.Getting started with struts 2 was a piece of cake , more ever with the site-mesh integration it just blew me off.It worked fine.However off late i encountered a requirement stating usage of tiles with struts 2 .Initially i thought of it as easy but as i ususally feel of easy things , it turned out to be real pain.Eventually a couple of hours of fight saw me through the struts 2 defences and led to a good integration of tiles2 with struts .This is a walk through is to achieve the same.The versions for struts 2 and tiles 2 used are 2.0.6 and any further versions haven’t been tested by me.

    Assumptions:

    • JDK 1.5 installed
    • Tomcat 6.0 installed
    • You can create a struts 2 web application in eclipse or any other ide.

    The process involves the following steps:

    1. Download the binaries
    2. Changing the configuration files for application.

    1.Download the binaries

    I have used struts 2.0.6 libraries , which can be downloaded from Here .

    Tiles 2.0.6 binaries can be downloaded from Here

    Extract the jar’s from both the zip files and put them in your lib directory of your web project.

    2. Changing the configuration files for application.

    This involves changing web.xml ,struts.xml and tiles .xml

    web.xml

    Add following section to web.xml

    <listener>
    <listener-class>
    org.apache.struts2.tiles.StrutsTilesListener
    </listener-class>
    </listener>

    <context-param>

    <param-name>tilesDefinitions</param-name>
    <param-value>/WEB-INF/tiles.xml</param-value>
    </context-param>

    struts.xml
    add following section to struts.xml

    <package name=”org.action” extends=”tiles-default” >
    <action name=”myaction” class=”org.action.YourAction”>
    <result name=”INPUT” type=”tiles”>tiles:test</result>
    </action>
    </package>

    here “org.action” is the package name in which the action class resides.

    tiles.xml

    add the following snippet to tiles.xml file within “tiles-definitions”

    <definition name=”tiles:layout” template=”/WEB-INF/pages/layout.jsp”>
    <put name=”body” value=”"/>
    </definition>
    <definition name=”tiles:test” extends=”tiles:layout”>
    <put name=”body” value=”/WEB-INF/pages/test.jsp”/>
    </definition>

    Rest of the struts 2 application remains unaltered. Note that tiles.xml should be in WEB-INF folder as mentioned in the web.xml.The jsp’s and action should be present at correct locations and its all done .

    posted on 2009-03-22 22:25 seal 閱讀(316) 評(píng)論(0)  編輯  收藏 所屬分類: Struts
    主站蜘蛛池模板: jizz在线免费观看| 99久久99久久精品免费看蜜桃| 亚洲国产成人高清在线观看| 国产精品怡红院永久免费| 久久精品国产亚洲AV天海翼 | 成年在线观看免费人视频草莓| 无码天堂va亚洲va在线va| 久久精品国产亚洲| 免费看美女被靠到爽| 午夜免费啪视频在线观看 | 欧洲人成在线免费| 亚洲精品女同中文字幕| 亚洲日本va中文字幕久久| 最近中文字幕无免费视频| 日韩电影免费在线观看网站| 亚洲啪AV永久无码精品放毛片| 亚洲精品tv久久久久久久久| 毛片免费在线播放| 九九精品成人免费国产片| 亚洲av成人中文无码专区| 亚洲美免无码中文字幕在线| 亚洲精品无码久久不卡| 国产成人免费高清激情视频| 嫩草在线视频www免费观看| 特级毛片A级毛片100免费播放| 亚洲成年人免费网站| 精品亚洲一区二区| 全黄a免费一级毛片人人爱| 四虎在线免费视频| 无码人妻精品中文字幕免费| 又黄又大的激情视频在线观看免费视频社区在线 | 国产精品成人亚洲| 亚洲国产片在线观看| 亚洲成av人片在线观看无码不卡| 又粗又大又硬又爽的免费视频| 日本亚洲免费无线码| 99久久免费看国产精品| 18禁超污无遮挡无码免费网站| 尤物视频在线免费观看| 老牛精品亚洲成av人片| 亚洲欧美日韩中文字幕在线一区 |