First of all my JSTl code works on my server because i have the proper Jar file in the Lib folder in tomcat7. This is just really an IDEA problem. My questions comes down to where i put the same jar file in my file directory within IntelliJ.
I have ran into a error in IntelliJ and JSTL.
My problem is that when i use
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
It results in Cannot resolve taglib with uri. I have tried different Jar files and I do know that i have to correct version for my servlet.
Im running tomcat7 on Ubuntu Server 15.04, and IntelliJ 14.1.3.
I have tried importing the jar file though the Project Structure, and including it in various places but still the same error after re-building the project, and closing down and reopening the IDEA.
This sample code runs when deployed to tomcat but IntelliJ keeps giving errors.
<table border="1">
<c:forEach var="a" items="${data}">
<tr>
<td>${a}</td>
</tr>
</c:forEach>
</table>
<c:forEach begin="0" end="255" var="i">
<span style='color:rgb(
<c:out value="${i}"/>,
<c:out value="${i}"/>,
<c:out value="${i}"/>);'>
<c:out value="${i}"/></span> <br />
</c:forEach>
I would like to know how to stop IntelliJ from giving errors on my Syntax even though the code works.
I have read JSTL in IntelliJ gives errors in JSP
and
https://www.jetbrains.com/idea/features/jsp_editor.html
Still no luck.
First add this to the top of your .jsp
file:
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
It will still give syntax error but you can fix that by adding javax.servlet:jstl:1.2
as a module dependency. To do that, follow these steps:
dependencies
tab in the modules
section.+
icon →
library →
From Maven.javax.servlet:jstl:1.2
in the search bar and press OK and it will download and add the above mentioned library as a module.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With