我正在使用Struts 1.3.10进行演示:
- 在此处下载最新的struts库(http://struts.apache.org/download.cgi#struts1310)。请记住, 完整发行版 是您必须下载的,因为它包含带有Struts TLD的战争文件。
- 在Web应用程序上,将下载的存档文件中的所有lib复制到
/WEB-INF/lib
文件夹中。 - 对于JSTL库(与struts一起很好地工作),请转到此处(http://java.sun.com/products/jsp/jstl/)
- 一旦有了Struts TLD和JSTL Tld,就将它们放在
/WEB-INF/tld/
文件夹下(它 必须 位于/ WEB-INF /文件夹中)。 - 在web.xml上,添加以下内容(在
<web-app>
元素下方)<jsp-config><taglib> <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri> <taglib-location>/WEB-INF/tld/struts-bean.tld</taglib-location></taglib><taglib> <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri> <taglib-location>/WEB-INF/tld/struts-html.tld</taglib-location></taglib><taglib> <taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri> <taglib-location>/WEB-INF/tld/struts-logic.tld</taglib-location></taglib><taglib> <taglib-uri>/WEB-INF/struts-nested.tld</taglib-uri> <taglib-location>/WEB-INF/tld/struts-nested.tld</taglib-location></taglib><taglib> <taglib-uri>/WEB-INF/struts-tiles.tld</taglib-uri> <taglib-location>/WEB-INF/tld/struts-tiles.tld</taglib-location></taglib><taglib> <taglib-uri>/WEB-INF/sslext.tld</taglib-uri> <taglib-location>/WEB-INF/tld/sslext.tld</taglib-location></taglib><taglib> <taglib-uri>/WEB-INF/struts-layout.tld</taglib-uri> <taglib-location>/WEB-INF/tld/struts-layout.tld</taglib-location></taglib><!-- Sun's JSTL --><taglib> <taglib-uri>http://java.sun.com/jstl/fn</taglib-uri> <taglib-location>/WEB-INF/tld/fn.tld</taglib-location></taglib><taglib> <taglib-uri>http://java.sun.com/jstl/fmt</taglib-uri> <taglib-location>/WEB-INF/tld/fmt.tld</taglib-location></taglib><taglib> <taglib-uri>http://java.sun.com/jstl/fmt-1-0</taglib-uri> <taglib-location>/WEB-INF/tld/fmt-1_0.tld</taglib-location></taglib><taglib> <taglib-uri>http://java.sun.com/jstl/fmt-rt</taglib-uri> <taglib-location>/WEB-INF/tld/fmt-rt.tld</taglib-location></taglib><taglib> <taglib-uri>http://java.sun.com/jstl/fmt-1-0-rt</taglib-uri> <taglib-location>/WEB-INF/tld/fmt-1_0-rt.tld</taglib-location></taglib><taglib> <taglib-uri>http://java.sun.com/jstl/core</taglib-uri> <taglib-location>/WEB-INF/tld/c.tld</taglib-location></taglib><taglib> <taglib-uri>http://java.sun.com/jstl/core-1-0</taglib-uri> <taglib-location>/WEB-INF/tld/c-1_0.tld</taglib-location></taglib><taglib> <taglib-uri>http://java.sun.com/jstl/core-rt</taglib-uri> <taglib-location>/WEB-INF/tld/c-rt.tld</taglib-location></taglib><taglib> <taglib-uri>http://java.sun.com/jstl/core-1-0-rt</taglib-uri> <taglib-location>/WEB-INF/tld/c-1_0-rt.tld</taglib-location></taglib><taglib> <taglib-uri>http://java.sun.com/jstl/sql</taglib-uri> <taglib-location>/WEB-INF/tld/sql.tld</taglib-location></taglib><taglib> <taglib-uri>http://java.sun.com/jstl/sql-1-0</taglib-uri> <taglib-location>/WEB-INF/tld/sql-1_0.tld</taglib-location></taglib><taglib> <taglib-uri>http://java.sun.com/jstl/sql-rt</taglib-uri> <taglib-location>/WEB-INF/tld/sql-rt.tld</taglib-location></taglib><taglib> <taglib-uri>http://java.sun.com/jstl/sql-1-0-rt</taglib-uri> <taglib-location>/WEB-INF/tld/sql-1_0-rt.tld</taglib-location></taglib><taglib> <taglib-uri>http://java.sun.com/jstl/x</taglib-uri> <taglib-location>/WEB-INF/tld/x.tld</taglib-location></taglib><taglib> <taglib-uri>http://java.sun.com/jstl/x-1-0</taglib-uri> <taglib-location>/WEB-INF/tld/x-1_0.tld</taglib-location></taglib><taglib> <taglib-uri>http://java.sun.com/jstl/x-rt</taglib-uri> <taglib-location>/WEB-INF/tld/x-rt.tld</taglib-location></taglib><taglib> <taglib-uri>http://java.sun.com/jstl/x-1-0-rt</taglib-uri> <taglib-location>/WEB-INF/tld/x-1_0-rt.tld</taglib-location></taglib>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)