Reputation: 5118
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?
Upvotes: 15
Views: 41349
Reputation: 1
If ur using maven dependency see wether the jstl 1.2 dependency is added properly then.
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
use this tag in ur jsp page.
And also if its geving url error then just rewrite the url and save it.
And also change the version of java to 8 and change the spring boot version to 2.7.17
Upvotes: 0
Reputation: 137
Add the given line on top of the JSP file:
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
And, one more thing you need to do is,
Copy the dependency from this maven repo link & paste it on pom.xml
of the project.
Upvotes: 0
Reputation: 1108852
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).
[jstl]
tag which you put on the question yourself and clicking the info link on the popbox)Upvotes: 34
Reputation: 170
I faced same issue during practice coding with jsp. Following worked for me - (In short)
Use jstl 1.2.jar
in place of jstl.jar
with:
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
Upvotes: -1
Reputation: 1
I am studying Spring Framework Security tutorial. I imported a maven tutorial project, compiled and saw the warning "<c:out> unknown tag". The jstl-1.2.jar was already on the project class path. The problem was that the project came with 1.6 run time library, and I have only 1.7 installed on my machine. I replaced the libraries and it solved the problem.
Upvotes: 0