Struts2整合SiteMesh
生活随笔
收集整理的這篇文章主要介紹了
Struts2整合SiteMesh
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
http://takeme.iteye.com/blog/1716488
1.導入Struts2的jar 和 sitemesh.jar 和 Struts2-sitemesh-plugin.jar?
commons-fileupload-1.2.2.jar?
commons-io-2.0.1.jar?
commons-lang3-3.1.jar?
commons-logging-1.1.1.jar?
freemarker-2.3.19.jar?
javassist-3.11.0.GA.jar?
ognl-3.0.5.jar?
sitemesh-2.4.2.jar?
struts2-core-2.3.4.jar?
struts2-sitemesh-plugin-2.3.4.1.jar?
xwork-core-2.3.4.jar?
2.在web.xml中配置 Struts sitemesh攔截器 注意有一定的順序?
3.在webroot下的descorators目錄下建立 myDecorator.jsp 裝飾器頁面?
Html代碼??
4.在web-inf 下建立 裝飾器描述文件 decorators.xml?
Xml代碼??
5.建立 實體類 Song.java?
Java代碼??
6.action?
Java代碼??
7.配置? struts.xml?
Xml代碼??
8.allSongs.jsp?
Html代碼??
9.訪問localhost:8080/Struts2AndSiteMesh/songs/allSongs.action 可以看到 頁面中加入?
? top 和bottom?
? 如果將 decorations.xml中的pattern 改成 <pattern>/singer/*</pattern>?
? 那上面的訪問的頁面就沒有經過裝飾器頁面 修飾?
與50位技術專家面對面20年技術見證,附贈技術全景圖
總結
以上是生活随笔為你收集整理的Struts2整合SiteMesh的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Windows平台下安装Hadoop
- 下一篇: MySQL数据类型及范围用法一览表