org.apache.jasper.JasperException: /taglib/ifelse.jsp(17,2) According to TLD or attribute directive
2013-01-18 16:41
239 查看
在做课设的时候
用到<s:if test="$session.userName">
发现上边的异常
在网上找了找答案,发现下边的和我的错误时一样的,故拿来借鉴!
在运行struts2标签页面时报错,代码如下:
<%@ page language="java" pageEncoding="gbk"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>index</title>
</head>
<body>
<s:set name="age" value="29" />
<s:if test="${age > 60}">
老年人
</s:if>
<s:elseif test="${age > 35}">
中年人
</s:elseif>
<s:elseif test="${age > 15}" id="wawa">
青年人
</s:elseif>
<s:else>
少年
</s:else>
</body>
</html>
错误提示如下:
2008-3-12 10:53:13 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: /taglib/ifelse.jsp(17,2)According to TLD or attribute directive in tag file, attribute test does not accept any expressions
经查找发现解决办法如下
错误提示是,该标签不能接受el表达式
struts2.0标签主要支持的是ognl表达式
所以把<s:elseif test="${age > 35}">
改为<s:elseif test="#age>35">
就ok了
还有人说
struts2 _2.0.11 版本不支持 s 标签嵌套 EL
struts2_2.0.08 这个支持但是不支持集合封装pojo。。。。
用到<s:if test="$session.userName">
发现上边的异常
在网上找了找答案,发现下边的和我的错误时一样的,故拿来借鉴!
在运行struts2标签页面时报错,代码如下:
<%@ page language="java" pageEncoding="gbk"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>index</title>
</head>
<body>
<s:set name="age" value="29" />
<s:if test="${age > 60}">
老年人
</s:if>
<s:elseif test="${age > 35}">
中年人
</s:elseif>
<s:elseif test="${age > 15}" id="wawa">
青年人
</s:elseif>
<s:else>
少年
</s:else>
</body>
</html>
错误提示如下:
2008-3-12 10:53:13 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: /taglib/ifelse.jsp(17,2)According to TLD or attribute directive in tag file, attribute test does not accept any expressions
经查找发现解决办法如下
错误提示是,该标签不能接受el表达式
struts2.0标签主要支持的是ognl表达式
所以把<s:elseif test="${age > 35}">
改为<s:elseif test="#age>35">
就ok了
还有人说
struts2 _2.0.11 版本不支持 s 标签嵌套 EL
struts2_2.0.08 这个支持但是不支持集合封装pojo。。。。
相关文章推荐
- org.apache.jasper.JasperException: /mainpage.jsp (line: 25, column: 2) According to TLD or attribute
- org.apache.jasper.JasperException: xxxx.jsp(118,24) Attribute style invalid for tag formatNumber according to TLD
- jsp使用jstl、el标签时出现According to TLD or attribute directive in tag file, attribute items does not acc错误
- JSP中出现According to TLD or attribute directive in tag file
- JSP中出现According to TLD or attribute directive in tag file
- JSP异常--According to TLD or attribute directive in tag file
- JSP中出现According to TLD or attribute directive in tag file
- SSH2练习中问题之org.apache.jasper.JasperException: /findAllProductions_list.jsp(31,1) TLD又はタグファイル中のattribute指示子に従って属性itemsはどんな式も受け付けません解决方案
- JSP中出现According to TLD or attribute directive in tag file, attribute value does not accept any expre
- JSP中出现According to TLD or attribute directive in tag file
- Exception:According to TLD or attribute directive in tag file, attribute value does not accept any expression
- JSP报错(一) According to TLD or attribute directive in tag file, attribute value does not accept any ex
- JSP中出现According to TLD or attribute directive in tag file, attribute value does not accept any expressions(转贴)
- Troubleshooting - Exception: According to TLD or attribute directive in tag file, attribute value does not accept any expressions.
- JSP中出现According to TLD or attribute directive in tag file
- JSP中出现According to TLD or attribute directive in tag file..
- JSP中出现According to TLD or attribute directive in tag file, attribute value does not accept any expressions
- JSTL Exception: According to TLD or attribute directive in tag file, attribute items does not accept any expressions Solution
- JSP中出现According to TLD or attribute directive in tag file
- org.apache.jasper.JasperException: Failed to load or instantiate TagExtraInfo class: org.apache.struts.taglib.bean.CookieTei错误解决方法。