日期:2014-05-16  浏览次数:20423 次

使用JSTL标签异常

我使用JSTL标签,如下所示:

?

<c:when test="${!empty flist && fn:length(flist)>3 } ">
     <c:forEach  items="${flist }" var="f" begin="${fn:length(flist)-3}" end="${fn:length(flist)}">
     <c:if test="${f.fileState!=1}">
     <tr><td width="90px;"><a href="<c:url value="/showFileIndex.do" />"><font color="blue"> [知识培训]:</a></font></td><td  align="left"><a href="<c:url value="/file/filePriview.do?filePK=${f.fileId}" />">${fnx:subStringHtml(f.fileAliaName,18,'...',false) }</td>
     <td width="60px;"><font color="blue">发布人 :</font></td><td  align="left">${fnx:subStringHtml(f.user.userName,18,'...',false) }</td>
     <td width="80px;"><font color="blue">发布时间 :</font></td><td  align="left"><fmt:formatDate value="${f.uploadDate }" pattern="yyyy-MM-dd" /></td>
     </tr>
     </c:if>
    </c:forEach>
    </c:when>

?运行时报如下异常:

?

严重: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: Unable to compile class for JSP: 

An error occurred at line: 93 in the jsp file: /WEB-INF/views/informations.jsp
The method setTest(boolean) in the type WhenTag is not applicable for the arguments (String)
90:     </c:choose>
91: 
92:     <c:choose>
93:     <c:when test="${!empty flist && fn:length(flist)>3 } ">
94:      <c:forEach  items="${flist }" var="f" begin="${fn:length(flist)-3}" end="${fn:length(flist)}">
95:      <c:if test="${f.fileState!=1}">
96:      <tr><td width="90px;"><a href="<c:url value="/showFileIndex.do" />"><font color="blue"> [abcdefghijk]:</a></font></td><td  align="left"><a href="<c:url value="/file/filePriview.do?filePK=${f.fileId}" />">${fnx:subStringHtml(f.fileAliaName,18,'...',false) }</td>


Stacktrace:
	at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
	at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
	at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:439)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:334)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:312)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:299)
	at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:586)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
	at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:551)
	at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:488)
	at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:230)
	at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
	at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1060)
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:798)
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:647)
	at org.springframework.web.servlet.F