相亲们,我最近学习生成静态文件,freeer使用struts的标签,可是死活不对.一下是我的配置<#assign s=JspTaglibs["/WEB-INF/struts-tags.tld"]>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>welcome!</title>
</head>
<body>
<#list userList as user>
<h1>Welcome ${user.name}! id:${user.id}</h1><br/>
</#list>
<@s.iterator value="userList" status="i">
<@s.property value="id"/>
<@s.property value="name"/>
<br/>
</@s.iterator>
</body>
</html>
其中我已经把struts-tags.tld放入到web-inf下错误提示:==> assignment: s=JspTaglibs["/WEB-INF/struts-tags.tld"]
freeer.core.InvalidReferenceException: Expression JspTaglibs is undefined第一行通不过去,于是搜索在web.xml加上 <servlet>
<servlet-name>JSPSupportServlet</servlet-name>
<servlet-class>org.apache.struts2.views.JspSupportServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
还是一样的错误,网上一搜,说是不用加"<#assign s=JspTaglibs["/WEB-INF/struts-tags.tld"]>"就可以了
于是我去掉了,可还是遇到<@s.iterator value="userList" status="i">有错误.
请高手明示.这个应该是一些细节的问题,没有注意到.谢了
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>welcome!</title>
</head>
<body>
<#list userList as user>
<h1>Welcome ${user.name}! id:${user.id}</h1><br/>
</#list>
<@s.iterator value="userList" status="i">
<@s.property value="id"/>
<@s.property value="name"/>
<br/>
</@s.iterator>
</body>
</html>
其中我已经把struts-tags.tld放入到web-inf下错误提示:==> assignment: s=JspTaglibs["/WEB-INF/struts-tags.tld"]
freeer.core.InvalidReferenceException: Expression JspTaglibs is undefined第一行通不过去,于是搜索在web.xml加上 <servlet>
<servlet-name>JSPSupportServlet</servlet-name>
<servlet-class>org.apache.struts2.views.JspSupportServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
还是一样的错误,网上一搜,说是不用加"<#assign s=JspTaglibs["/WEB-INF/struts-tags.tld"]>"就可以了
于是我去掉了,可还是遇到<@s.iterator value="userList" status="i">有错误.
请高手明示.这个应该是一些细节的问题,没有注意到.谢了
解决方案 »
- 新手急求救啊,tomcat5.5.17报错:flushing the buffer in release()。跪谢
- 如何将对象序列化到Cookie
- 有没有这种现成的东西
- tomcat页面打不开
- for循环。。。?
- struts2 自定义验证拦截器的疑惑和标签<s:property>
- Rose最新版本到底是 Rose 7 还是 Rose 2007?
- jconnect6 连接sybase iq 15 问题
- 在eclipse+jboss-ide1.4+jboss4.0.0下jboss4.0.0不能启动,出现下面的错误,是什么原因,希望大家看看也许以后你会碰到?
- 如何通过回话bean访问实体bean
- java program如何catch oracle 拋出的异常
- jsp相册系统
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapfourm.org/DTD/wml_1.1.xml">
<wml>
<card id="FirstCard" title="欢迎使用掌上立马好代缴系统">
<@s.action name="head" executeResult=true>
</@s.action>
${feetoremainmsg!''}
<br/><@s.action name="foot" executeResult=true>
</@s.action>
</card>
</wml>"<#assign s=JspTaglibs["/WEB-INF/struts-tags.tld"]>"
这行确实不用加,估计你的问题还是在于:
<@s.iterator value="userList" status="i">
<@s.property value="id"/>
<@s.property value="name"/>
<br/>
</@s.iterator> 吧?
但是你看你生成的html就是有问题 对吧
我也不明白生成html的时候不识别这个导入标签的这一行