国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費(fèi)電子書(shū)等14項(xiàng)超值服

開(kāi)通VIP
struts2.0中配置tiles

struts2.0中配置tiles[轉(zhuǎn)自haoxing272專(zhuān)欄]

1.在WEB-INF/lib下加入所需的jar包 

    commons-digester-1.6.jar,

    tiles-core-2.0-20070207.130156-4.jar,
    tiles-api-2.0-20070207.130156-4.jar
    struts2-tiles-plugin-2.0.6.jar,
struts2-core-2.0.6.jar
xwork-2.0.1.jar,
2. 以下內(nèi)容添加到web.xml
 <context-param>
       <param-name>org.apache.tiles.CONTAINER_FACTORYparam-name>
       <param-value>
           org.apache.struts2.tiles.StrutsTilesContainerFactory
       param-value>
    context-param>
   
    <context-param>
       <param-name>   org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG
       param-name>
       <param-value>/WEB-INF/tiles.xmlparam-value>
    context-param>
 
    <listener>
       <listener-class>
           org.apache.struts2.tiles.StrutsTilesListener
       listener-class>
    listener>
3.在WEB-INF下添加和tiles.tld和tiles.xml文件,其中tiles.tld內(nèi)容為tiles-core-2.0-20070207.130156-4.jar包中META_INF/tiles-core.tld的內(nèi)容。
tiles.xml內(nèi)容:
xml version="1.0" encoding="GB2312" ?>
DOCTYPE tiles-definitions PUBLIC
       "-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
       "http://jakarta.apache.org/struts/dtds/tiles-config.dtd">
<tiles-definitions>
    <definition name="myapp.homepage" template="layout.jsp">
       <put name="title" value="Tiles tutorial homepage" />
       <put name="header" value="/tiles/header.jsp" />
       <put name="menu" value="/tiles/menu.jsp" />
       <put name="body" value="/tiles/cBody.jsp" />
       <put name="footer" value="/tiles/footer.jsp" />
    definition>
tiles-definitions>
   
4.struts.xml 為:
DOCTYPE struts PUBLIC  
        "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"  
        "http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
    <package name="default" extends="tiles-default">
      
          
           <result name="success" type="tiles">myapp.homepageresult>
       action>
       package>
struts>
紅色部分根據(jù)自己項(xiàng)目定。注意extends="tiles-default"
5創(chuàng)建layout.jsp
<html>
    <head>
       <title>title>
    head>
    <body>
       <table width="768px" height="800px" border="2" align="center">
      
           <tr>
              <td colspan="2" align="center" valign="top" width="768px" height="100px" bgcolor="#80ff80">
                  <tiles:insertAttribute name="header" />
              td>
           tr>
           <tr>
              <td align="center" width="150px" height="800px" bgcolor="#00ff00">
                  <tiles:insertAttribute name="menu" />
              td>
              <td align="right" width="618px" height="800px" bgcolor="#ff80c0">
                  <tiles:insertAttribute name="body" />
              td>
           tr>
           <tr>
              <td colspan="2" bgcolor="#00ff40" height="100px">
                  <tiles:insertAttribute name="footer" />
              td>
           tr>
       table>
    body>
html>
 
6.根據(jù)
<put name="title" value="Tiles tutorial homepage" />
       <put name="header" value="/tiles/header.jsp" />
       <put name="menu" value="/tiles/menu.jsp" />
       <put name="body" value="/tiles/cBody.jsp" />
       <put name="footer" value="/tiles/footer.jsp" />
WebRoot下創(chuàng)建tiles目錄和相應(yīng)jsp文件
7.下載源代碼資源http://download.csdn.net/user/haoxing272。
本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)。
打開(kāi)APP,閱讀全文并永久保存 查看更多類(lèi)似文章
猜你喜歡
類(lèi)似文章
深入Struts 1.1
struts2 示例
使用struts2.5版本遇到的問(wèn)題
Struts2+Spring集成合并
struts2中各個(gè)jar包的具體作用
Struts2教程
更多類(lèi)似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服