`

Express Learning Struts Menu

阅读更多

Express Learning Struts Menu

The firts go struts menu official site dowload struts-menu-X.X.X.war file,把文件放到Tomecate 目录webapps 目录下,然后启动tomcate,访问http://localhost:9090 /struts-menu-X.X.X,you will shoult effect。

The following introduction express create struts - menu item.

1.拷贝相应的类库到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

2.拷贝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也会跟着增加。

 

参考

http://code.google.com/p/strutsmenu/source/

 

 

 

 

 

分享到:
评论

相关推荐

    NVM-Express 1.2

    标题“NVM-Express 1.2”指的是非易失性内存表达规范的1.2版本,这是一个高速存储接口标准,用于计算机和固态驱动器(SSD)之间的通信。NVM Express(NVMe)是一种旨在实现固态存储设备快速访问的接口,它利用PCI ...

    PCI Express Technology 3.0-MindShare Press

    PCI Express Technology 3.0 PCI Express 是一种高性能的总线技术,应用于计算机系统中的数据传输。 MindShare Press 的《PCI Express Technology 3.0》是一本涵盖 PCI Express 技术的详细指南,包括 PCI Express ...

    PCI Express Base Specification Revision 2.0 协议规范

    "PCI Express Base Specification Revision 2.0 协议规范" PCI Express Base Specification Revision 2.0 协议规范是PCI-SIG(Peripheral Component Interconnect Special Interest Group)发布的一份关于PCI ...

    STEP语言-Express参考手册

    EXPRESS 是一种规范化的信息模型语言。它提供了对论域中对象的规范(或定义)的详 细描述,同时地提供了与这些对象有关的信息和约束的描述。EXPRESS 主要用于信息建模。关于其标准可参见 ISO TR9007、ISO 10303。...

    learning-express-cluster, post"Node Cluster and Express"的伴随代码.zip

    learning-express-cluster, post"Node Cluster and Express"的伴随代码 node 集群和 Express这是 post node 集群和 Express的附带代码。要运行这里应用程序,你需要 node.js ( 0.10 随以 npm ) 。运行之前,应该使用...

    NoteExpress.rar

    NoteExpress是一款广受欢迎的文献管理软件,主要用于科研工作者、学者和学生进行文献检索、阅读、整理和引用。这款软件能够帮助用户高效地管理和组织大量的学术文献,提高研究工作的效率。 在"NoteExpress.rar...

    PCI Express System Architecture

    We find the latest PCI Express book from MindShare to have the same content and high quality as all the others.' --Nader Saleh, CEO/President, Catalyst Enterprises, Inc. PCI Express is the third-...

    express中间件当做前端服务器的安全漏洞处理

    在使用Express作为前端服务器的过程中,安全是至关重要的。Express是一个流行的Node.js框架,它简化了构建Web应用和服务的过程。然而,如果不正确配置或使用中间件,可能会引入安全漏洞。本篇文章将深入探讨Express...

    Optics EXpress投稿要求

    根据提供的信息,我们可以总结出以下关于“Optics Express投稿要求”的相关知识点: ### 一、Optics Express期刊简介 Optics Express(OE)是美国光学学会(OSA)出版的一本高质量、高影响力的开放获取期刊,专注...

    QLExpress实战宝典

    ### QLExpress实战宝典——淘宝规则引擎应用详解 #### 一、背景介绍 在复杂的电商平台上,诸如淘宝这样的大型平台需要处理各种各样的规则,比如卖家资格认证、商品上架审核等。为了应对这些复杂多变的业务需求,...

    NoteExpress官方简明教程

    NoteExpress参考文献管理软件简要教程 一.什么是NoteExpress 参考文献管理软件 二.NoteExpress软件安装 三.建立自己第一个NoteExpress 数据库 四.以参考文献为中心的个人知识管理 五. 研究时心得的记录---笔记...

    understanding machine learning theory-algorithms

    16.2.1 Kernels as a Way to Express Prior Knowledge 221 16.2.2 Characterizing Kernel Functions* 222 16.3 Implementing Soft-SVM with Kernels 222 16.4 Summary 224 16.5 Bibliographic Remarks 225 16.6 ...

    ExpressCache安装教程

    **ExpressCache安装教程** ExpressCache是一款优化电脑性能的软件,主要功能是通过在电脑的固态硬盘(SSD)上创建一个高速缓存,来提升传统机械硬盘(HDD)的读取速度,从而提高系统整体运行效率。本文将详细介绍...

    行业教育软件-学习软件-Language Learning Express 0.97.zip

    "Language Learning Express 0.97"是一款专为语言学习者设计的教育软件,它集成了多种教学资源和工具,旨在提升用户的学习效率和语言掌握程度。从标题和描述来看,我们可以推测这款软件可能包含了丰富的语言学习课程...

    Express框架.docx

    Express 框架详解 Express 框架是基于 Node.js 平台的 Web 应用开发框架,提供了一系列强大特性,帮助开发者创建各种 Web 应用。 Express 框架的特性包括方便简洁的路由定义方式、对获取 HTTP 请求参数的简化处理、...

    Visual studio express 2010

    《Visual Studio Express 2010:C# 开发者的基石》 Visual Studio Express 2010 是微软推出的一款轻量级集成开发环境(IDE),专为初学者和小型团队设计,尤其针对C#编程语言。这款软件是Visual Studio家族的一部分...

    VC++2005Express 独立安装包

    **VC++2005 Express 独立安装包** 微软的Visual C++ 2005 Express Edition是一款免费的集成开发环境(IDE),专为初学者和专业开发者设计,用于编写C++应用程序。它是微软Visual Studio 2005系列的一部分,提供了...

    关于SQLEXPRESS服务无法启动问题

    SQLEXPRESS服务无法启动问题解决方案 在本文中,我们将讨论SQLEXPRESS服务无法启动的问题,并提供解决方案。该问题通常是由TCP/IP协议的冲突引起的,下面我们将详细介绍问题的成因和解决方法。 一、问题描述 SQL...

    qlexpress java表达式

    《QLEXPRESS Java表达式解析与应用》 在Java编程中,表达式扮演着至关重要的角色,它们是程序逻辑的基础。QLEXPRESS是一种专为Java设计的强大的表达式处理库,它提供了灵活和高效的解决方案,使得在Java应用程序中...

    IExpress 2.0   IExpress 2.0  IExpress 2.0

    IExpress 2.0 是微软提供的一种集成包装和部署工具,它允许用户创建自解压安装包,方便软件的分发和安装。这个工具在Windows操作系统中内置,主要用于创建简单的安装程序,尤其适用于那些不涉及复杂安装逻辑的小型...

Global site tag (gtag.js) - Google Analytics