StrutsMenu Introduction

zhaozj2021-02-16  180

Current version 1.3,

From this to the binary / source file

When developing web pages, we often need to use some menu (selection menu), which may be a drop-down option, which may be a label menu, may be a tree menu, Struts-menu, help us achieve some common menus, saving The time we have developed, there is currently the following.

SimpleMenuDisplayer DropDownMenuDisplayer CoolMenuDisplayer CoolMenuDisplayer4 ListMenuDisplayer TabbedMenuDisplayer let's install example struts-menu, you can find a struts-menu.war files unzipped directory, put him% TOMCAT_HOME% / webapps / under, then use Http: // localhost: 8080 / struts-menu / you can see it.

Section 02 Struts-Menu installation

Put /LIB/Struts-Menu.jar in Web-INF / LIB / below /Lib/Struts-Menu.TLD to WEB-INF / LIB / to modify Web.xml Add to Taglib's call

/web-inf/struts-meu.tld

/web-inf/struts-meru.tld

Your JSP program needs to be added. <% @ Taglib URI = "/ Web-inf / struts-menu.tld" prefix = "menu"%>

Modify your web-inf / struts-config.xml, add Plugin

Establish /Web-inf/Menu-Config.xml as a Menu configuration file, the following is the example file

ENCODING = "UTF-8"?>

TYPE = "com.fgm.meb.Menu.displayer.dropdownmenudisplayer" />

TYPE = "com.fgm.meb.Menu.displayer.simplemenudisplayer" />

TYPE = "com.fgm.meb.Menu.displayer.coolmenudisplayer" />

TYPE = "com.fgm.meb.Menu.displayer.coolmenudisplayer4" />

Type = "com.fgm.meb.Menu.example.PermissionsformMenudisplayer" />

TYPE = "com.fgm.web.menu.displayer.listmenudisplayer" />

TYPE = "com.fgm.meb.Menu.displayer.tabbedmenudisplayer" />

Tooltip = "shows usage of the menu displayers use defaults."

Page = "/ menutest1.jsp" />

Tooltip = "Shows Customized Menu Displays."

Page = "/ menutest2.jsp" />

Tooltip = "Shows Menu Using CoolMenu3"

Page = "/ coolmenu1.jsp" />

Tooltip = "Shows Menu Using CoolMenu3 with forms."

Page = "/ coolmenu2.jsp" />

Tooltip = "EXAMPLE Use of Menu Disable and permission checking with coolmenus."

Page = "/ permissionsform.jsp" />

Tooltip = "Shows Menu Using CoolMenu4"

Page = "/ coolmenu4.jsp" />

Tooltip = "Shows Expandable DHTML LIST"

Page = "/ dhtmlexpandable.jsp" />

Page = "/ dhtmldropdown.jsp" />

Tooltip = "Shows Menus Based On User's Role"

Page = "/ rolesmenu.jsp" />

Tooltip = "Shows Tabbed-Based Menu"

Forward = "tabbedmenu" />

Section 03 Basic Menu - SimpleMenudisplayer TagLib Usage We can use Menu: UseMenudisplayer Name = "Simple" to call SimpleMenudisplayer, then specify menu: displaymenu to specify IndexMenu, will display menu-config.xml configuration menu component display Come out. If it is a multi-layer situation, it will also be rendered.

<% @ Page ContentType = "Text / HTML; Charset = UTF-8"%>

<% @ Taglib URI = "/ Web-INF / STRUTS-MENU.TLD" prefix = "menu"%>

Section 04 Down-down Menu - DropDownMenudisplayer Taglib Usage Handle Method, is the method that can be expanded and off, using SimpleMenudisplayer Lei, only need to change to menu: usemenudisplayer name = "Dropdown" is OK.

. SECTION 05 floating menu - CoolMenuDisplayer taglib use of a floating menu in addition to the change menu: useMenuDisplayer name = "CoolMenu" or "CoolMenu4" may also be a need to obtain CoolMenu javascript coolmenu3.js, CoolMenu4 is the need to obtain javascript coolmenu4. JS and cm_addins.js, and to configure related COOLMENU-Config.js, you can configure the graphics and colors of his display.

Section 06 Tree Player - Listmenudisplayer Taglib Using Method Tree Menu is set to "ListMenu" to "ListMenu". You can add menuexpandable.js to call expandMenus. Display all child nodes.

Section 07 Label menu - TAGLIB Using Tabbed MeNudisplayer Tag menu will be set to "TabbedMenu" and add TabbedMenu, and join tabbedMenu, step 08 conclusions can also be combined with Permission, Role, so that it has this permission Users can see and use those options, interested, can refer to the example, I think Mr. Sun Sancai, Taiwan

JSPWidget's Taglib component design style is more attractive, and if you can combine these two, you can make normally normally, then the dream developed by Web Ui-Component will come ...

转载请注明原文地址:https://www.9cbs.com/read-8409.html

New Post(0)