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

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

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

    DANCE WITH JAVA

    開發出高質量的系統

    常用鏈接

    統計

    積分與排名

    好友之家

    最新評論

    struts-menu使用教程

    struts-menu可以做成各種各樣的menu,這里演示一些簡單的用法。方便入門
    一、在sourceforge上下載最新版本的strutsmenu
    http://struts-menu.sourceforge.net/
    解壓縮zip文件得到struts-menu.war,解壓縮它,要用到里邊的js文件,imgage文件和css文件等
    這個本來是struts-menu的演示工程,本文簡化了里邊的東西,選擇里邊比較有代表性的幾個拿出。
    二、新建一個web工程。
    拷貝相應的類庫到lib目錄下。
    velocity-tools-view-1.0.jar
    velocity-1.4.jar
    struts-menu-2.4.2.jar
    struts-1.2.9.jar
    standard-1.0.6.jar
    log4j-1.2.8.jar
    jstl-1.0.6.jar
    commons-logging-1.0.4.jar
    等,基本就是struts-menu工程中的jar文件
    拷貝struts-menu工程中的common     image    scripts    styles   templates等目錄到新的web工程 
    拷貝taglib.jsp到webroot下
    三.新建一個jsp文件index.jsp內容如下
    <%@ include file="/taglibs.jsp"%>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        
    <title>Struts Menu Example Application</title>

        
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

        
    <script type="text/javascript" src="scripts/nicetabs.js"></script>
        
        
    <link rel="stylesheet" type="text/css" media="screen"
            href
    ="styles/global.css" />
        
    <link rel="stylesheet" type="text/css" media="screen"
          href
    ="styles/nicetabs.css" />

    </head>
    <body id="index">
    <div id="content" style="width: 100%">
        
    <h2>Struts Menu Examples</h2>
        
    <p>
            Click on the menu links below to see the different types of menus
            supported by Struts Menu.
        
    </p>

        
    <menu:useMenuDisplayer name="Velocity" config="/templates/index.html">
            
    <ul class="glassList">
            
    <menu:displayMenu name="indexMenu"/>
            
    </ul>
        
    </menu:useMenuDisplayer>

    </div>

    <div id="footer">
      
    <a href="http://struts-menu.sf.net">Struts Menu Homepage</a>
    </div>
    </body>
    </html>
    WEB-INF下建立struts-config.xml內容如下
    <?xml version="1.0" encoding="ISO-8859-1" ?>

    <!DOCTYPE struts-config PUBLIC
              
    "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
              
    "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
    <struts-config>
      
    <!-- ========== Plug Ins Configuration ================================== -->
      
    <plug-in className="net.sf.navigator.menu.MenuPlugIn">
        
    <set-property property="menuConfig" value="/WEB-INF/menu-config.xml"/>
      
    </plug-in>
    </struts-config>
    建立menu-config.xml內容如下
    <?xml version="1.0" encoding="UTF-8" ?>

    <MenuConfig>

      
    <Displayers>
        
    <Displayer   name="DropDown"
                     type
    ="net.sf.navigator.displayer.DropDownMenuDisplayer"/>
        
    <Displayer   name="Simple"
                     type
    ="net.sf.navigator.displayer.SimpleMenuDisplayer"/>
        
    <Displayer   name="CoolMenu"
                     type
    ="net.sf.navigator.displayer.CoolMenuDisplayer"/>
        
    <Displayer   name="CoolMenu4"
                     type
    ="net.sf.navigator.displayer.CoolMenuDisplayer4"/>
        
    <Displayer   name="MenuForm"
                     type
    ="net.sf.navigator.example.PermissionsFormMenuDisplayer"/>
        
    <Displayer   name="ListMenu"
                     type
    ="net.sf.navigator.displayer.ListMenuDisplayer"/>
        
    <Displayer   name="TabbedMenu"
                     type
    ="net.sf.navigator.displayer.TabbedMenuDisplayer"/>
        
    <Displayer   name="Velocity"
                     type
    ="net.sf.navigator.displayer.VelocityMenuDisplayer"/>
        
    <Displayer   name="XtreeMenu"
                     type
    ="net.sf.navigator.displayer.XtreeMenuDisplayer"/>
        
    <Displayer   name="CSSListMenu"
                     type
    ="net.sf.navigator.displayer.CSSListMenuDisplayer"/>
      
    </Displayers>

      
    <Menus>

        
    <Menu  name="indexMenu"  title="Examples">
            
    <!-- page attribute indicating a context relative resource.
                 The context path will be prepended to the value. 
    -->        
            
    <Item  title="tablemeun"
                   toolTip
    ="Shows table menu"
                   page
    ="/tablemenu.jsp"/>
            
    <Item  name="listmenu"  title="CoolMenu Example"
                   toolTip
    ="Shows menu using CoolMenu"
                   page
    ="/listmenu.jsp"/>
            
    <Item  title="Velocity XTree Menu"
                   toolTip
    ="Shows Velocity generated XTree"
                   page
    ="/velocity-xtree.jsp"/>
                   
        
    </Menu>

      
    </Menus>

    </MenuConfig>
    部署工程,訪問,出現如下效果。


    這是最普通的效果。
    試著往menu-config.xml中加入item對應的menu也會跟著增加。
    下篇文章將繼續提供一些更漂亮一些的menu

    posted on 2007-05-27 16:59 dreamstone 閱讀(6139) 評論(7)  編輯  收藏 所屬分類: web框架

    評論

    # re: struts-menu使用教程 2007-06-05 11:46 @yeafee

    繼續繼續加油加油  回復  更多評論   

    # re: struts-menu使用教程 2007-09-13 10:22 我是我

    出現錯誤:
    The menu repository could not be found  回復  更多評論   

    # re: struts-menu使用教程 2008-08-21 14:10 ttt

    @我是我
    因為系統沒有找到你的menu-config.xml文件,如果你用的是spring框架的話,要在applicationContext.xml中加上下面這句話:
    <bean id="menu" class="net.sf.navigator.menu.MenuLoader">
    <property name="menuConfig">
    <value>/WEB-INF/menu-config.xml</value>
    </property>
    </bean>
      回復  更多評論   

    # re: struts-menu使用教程 2008-09-22 08:09 SS

    <bean id="menu" class="net.sf.navigator.menu.MenuLoader">
    <property name="menuConfig">
    <value>/WEB-INF/menu-config.xml</value>
    </property>
    </bean>
    我添加了這一句話,還是不行,我是用spring security和struts menu結合時候用  回復  更多評論   

    # re: struts-menu使用教程 2008-09-23 08:47 SS

    希望能得到您的指導  回復  更多評論   

    # re: struts-menu使用教程[未登錄] 2009-04-07 09:35 kelvin

    沒有、templates/index.html
      回復  更多評論   

    # re: struts-menu使用教程[未登錄] 2014-01-01 14:08 程序員

    為什么我 用Eclipse 創建了個一樣的工程 沒有報錯,卻沒任何效果  回復  更多評論   

    主站蜘蛛池模板: 97亚洲熟妇自偷自拍另类图片| 亚洲国产欧美国产综合一区| 91精品免费在线观看| 亚洲综合欧美色五月俺也去| 免费午夜爽爽爽WWW视频十八禁| 免费无码又爽又刺激网站| 中文字幕亚洲码在线| 亚洲性日韩精品一区二区三区| 亚欧免费视频一区二区三区 | 亚洲欧美成aⅴ人在线观看| 亚洲一级片内射网站在线观看| 美丽的姑娘免费观看在线播放 | 在线观看免费为成年视频| A国产一区二区免费入口| 精品亚洲成在人线AV无码| 黑人大战亚洲人精品一区| 三年片在线观看免费观看高清电影 | 免费人成黄页在线观看日本| 亚洲日韩国产二区无码| 亚洲av福利无码无一区二区| 四虎影院永久免费观看| 国产精品成人观看视频免费| 一级特黄录像免费播放中文版| wwwxxx亚洲| 亚洲自偷自拍另类12p| 亚洲偷自拍拍综合网| 好男人视频在线观看免费看片| 无码午夜成人1000部免费视频| 无码日韩人妻AV一区免费l | 亚洲一区在线免费观看| 久久精品亚洲综合一品| 国产精品亚洲w码日韩中文| 黑人粗长大战亚洲女2021国产精品成人免费视频 | 国产成人无码区免费网站| 美国毛片亚洲社区在线观看| 亚洲jjzzjjzz在线观看| 亚洲宅男永久在线| 亚洲AV无码乱码在线观看富二代 | 国产香蕉九九久久精品免费| 少妇人妻偷人精品免费视频| 久久国产免费直播|