<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 :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
      618 隨筆 :: 87 文章 :: 225 評論 :: 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) 評論(0)  編輯  收藏 所屬分類: Struts
    主站蜘蛛池模板: 3344免费播放观看视频| 三年片在线观看免费观看大全一 | 色欲色欲天天天www亚洲伊| 美女网站免费福利视频| 亚洲国产精品乱码在线观看97| 18禁美女黄网站色大片免费观看| 青青草原精品国产亚洲av| 99xxoo视频在线永久免费观看| 亚洲自偷自拍另类12p| 国产免费的野战视频| 亚洲免费福利在线视频| 日本一道高清不卡免费| 曰批全过程免费视频免费看| 亚洲午夜成人精品电影在线观看| 久久久久久国产a免费观看不卡| 精品亚洲一区二区| 久久99青青精品免费观看| 亚洲精品美女视频| 成人在线免费观看| 羞羞视频在线观看免费| 亚洲网站在线观看| 嫩草视频在线免费观看| 曰批免费视频播放免费| 亚洲国产精品无码久久久蜜芽| 1024免费福利永久观看网站| 亚洲hairy多毛pics大全| 亚洲另类少妇17p| 999任你躁在线精品免费不卡| 亚洲人成网站色在线观看| 免费中文字幕在线观看| 一级毛片免费播放| 亚洲国产AV一区二区三区四区| 久久久久亚洲AV成人网| 18禁美女黄网站色大片免费观看 | 久久精品国产亚洲αv忘忧草| 国产精品成人四虎免费视频| 最新亚洲成av人免费看| 2020久久精品亚洲热综合一本 | 黄+色+性+人免费| 边摸边吃奶边做爽免费视频99 | 亚洲七七久久精品中文国产|