Posted on 2008-11-12 12:11
Kevin Meng 阅读(1202)
评论(0) 编辑 收藏
(1)定义在web.xml中定义JSPSupportServlet
<servlet>
<servlet-name>JSPSupportServlet</servlet-name>
<servlet-class>
org.apache.struts2.views.JspSupportServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
(2)把struts-html.tld复制到WEB-INF目录
(3)在页面最前面定义标签库
<#assign html=JspTaglibs["/WEB-INF/struts-html.tld"] />
(4)在<head>中引用标签
<@html.base/>
(5)
特别注意,在action的配置里面type="freemarker"去掉。因为如果加type="freemarker",那么base为action的路径,如http://localhost:8080/szmap/findpoi.go,如果去掉type="freemarker",那么base才为网页路径,如http://localhost:8080/szmap/find_poi.htm