struts2整合tiles及配置

2021-05-11 15:38:27 字數 1257 閱讀 8488

一.基本包(6個)

1.commons-logging-1.0.4.jar

2.commons-fileupload-1.2.1.jar

3.ognl-2.6.11.jar

4.struts2-core-2.1.6.jar

5.xwork-2.1.2.jar

6.freemarker-2.3.13.jar

二.整合tiles必須包(7個)

1.struts2-tiles-plugin-2.1.6.jar

2.tiles-api-2.0.6.jar

3.tiles-core-2.0.6.jar

4.tiles-jsp-2.0.6.jar

5.commons-digester-1.8.jar

6.commons-collections-3.2.jar

7.commons-beanutils-1.7.0.jar

三.把tiles-jsp-2.0.6.jar包下的tiles-jsp.tld拷貝到web-inf下.web-inf/tiles-jsp.tld

四.建立tiles.xml.放在web-inf下.web-inf/tiles.xml如下:

<?xml version="1.0" encoding="utf-8"?>

五.在web.xml新增如下:

org.apache.tiles.container_factory org.apache.struts2.tiles.strutstilescontaine***ctory org.apache.tiles.impl.basictilescontainer.definitions_config /web-inf/tiles.xml org.apache.struts2.tiles.strutstileslistener

六.修改struts.xml

xixi.haha

七.建立layout.jsp,注意存放路徑要和tiles.xml一致.

... <%@ taglib uri="/web-inf/tiles-jsp.tld " prefix="tiles"%> ...

....

八.建立head.jsp,siderbar.jsp,contant.jsp,footer.jsp

九.測試,建立index.jsp

....

十.豁然開朗

十一.感謝網友提供大量學習資料!

struts2整合tiles及配置

一.基本包 6個 1.commons logging 1.0.4.jar 2.commons fileupload 1.2.1.jar 3.ognl 2.6.11.jar 4.struts2 core 2.1.6.jar 5.xwork 2.1.2.jar 6.freemarker 2.3.13.j...

Struts 2整合Spring 經典

struts 2整合spring struts 2框架為整合其他技術提供了良好的可擴充套件性,可以通過外掛程式的方式來實現同spring技術的整合。13.2.1 整合步驟 struts 2框架整合spring很簡單,下面是整合的步驟。1 複製檔案。複製struts2 spring plugin x ...

struts2整合spring步驟

1.匯入spring的核心包 spring.jar 二者整合開發所需的包 struts spring plugin 2.0.6.jar 2.修改web.xml配置檔案 配置spring載入上下文時的 org.springframework.web.context.contextloaderliste...