c为C:出/>未知标签 [英] <c:out/> unknown tag

查看:206
本文介绍了c为C:出/>未知标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 < c:out value为什么我在左边的eclipse中收到错误提示消息= $ {变量} /> 

我收到错误未知标签(c:out)



我也包括在顶部

 <%@ page isELIgnored =false%> 

我需要添加一个jstl吗?

解决方案

你正在开发一个不支持JSTL的servlet容器,例如Tomcat。在这种情况下,您需要下载 jstl-1.2。 jar ,并放在您的webapp的 / WEB-INF / lib 文件夹中。 其他更改是必要的,也不能将一些网络错误的TLD文件解压缩到JAR文件和/或乱抛垃圾 / WEB-INF 教程建议。



在类路径中放置JAR文件( / WEB-INF / lib 文件夹后webapp的运行时类路径的一部分),您应该能够通过将以下行放在JSP的顶部,按照其文档

 <%@ taglib uri =http://java.sun.com/jsp/jstl/coreprefix =c%> 

JSTL 1.2在 web.xml 中需要至少一个Servlet 2.4声明, code>。所以确保您的 web.xml 具有正确的根声明,最好是您的servlet容器支持的最高支持版本(Tomcat 7是Servlet 3.0,Tomcat 6是Servlet 2.5而Tomcat 5.5是Servlet 2.4)。



另请参见:




Why I get error tip message in eclipse on left when I include the following line.

<c:out value=${variable}/>

I get the error "Unknown tag(c:out)"

I also included on top

<%@ page isELIgnored ="false" %> 

Is there a jstl I need to include?

解决方案

You're apparently developing with a servlet container which does not support JSTL out the box, such as Tomcat. In that case, you need to download jstl-1.2.jar and drop in /WEB-INF/lib folder of your webapp. No other changes are necessary, also not extracting the JAR file and/or littering the /WEB-INF folder with loose TLD files as some poor online tutorials suggest.

After having dropped the JAR file in the classpath (the /WEB-INF/lib folder is part of the webapp's runtime classpath), you should be able to reference the JSTL core taglib by putting the following line in top of your JSP as per its documentation:

<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

JSTL 1.2 requires a minimum of Servlet 2.4 declaration in web.xml. So make sure that your web.xml has the proper root declaration, preferably the highest supported version as supported by your servlet container (Tomcat 7 is Servlet 3.0, Tomcat 6 is Servlet 2.5 and Tomcat 5.5 is Servlet 2.4).

See also:

  • Our JSTL tag wiki page (you can get to this page by putting your mouse above the [jstl] tag which you put on the question yourself and clicking the info link on the popbox)

这篇关于c为C:出/&GT;未知标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆