一、在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內容如下






































































































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