I'm playing with Google App Engine in IntelliJ. I'm trying to use JSTL tags in my JSPs. I've tried two different URIs I found on the internet, and both of them give me errors:
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
and
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
It reds out the URL and says it cannot resolve taglib. I've tried dropping different parts of the URL to see if Ctrl-Space gives me any autocomplete love, but no luck.
Any ideas what I need to do to make this work?
Hi all, I am new to java and intellij, so i downloaded the student version and lunch java web page application the index. jsp worked fine after adding some html elements to it.
JSP lets you even define your own tags (you must write the code that actually implement the logic of those tags in Java). JSTL is just a standard tag library provided by Sun (well, now Oracle) to carry out common tasks (such as looping, formatting, etc.).
JSTL stands for JSP Standard Tag Library. JSTL is the standard tag library that provides tags to control the JSP page behavior. JSTL tags can be used for iteration and control statements, internationalization, SQL etc.
How to handle error object in JSP using JSTL tags? You can make use of JSTL tags to write an error page ShowError.jsp with better structure and more information − Opps... java.lang.RuntimeException: Error condition!!!
Adding the old javax.servlet:jstl dependency solves the issue. The problem is there because by default jstl jar is added for scope Compile Time Only We need to make it to get added for Runtime to do that. Click your project name and press F4 to bring up the module settings dialog or Right Click on Project name and find Open Module Settings.
The problem is there because by default jstl jar is added for scope Compile Time Only We need to make it to get added for Runtime to do that. Click your project name and press F4 to bring up the module settings dialog or Right Click on Project name and find Open Module Settings. Go to the dependencies tab in the modules section.
Search for 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. Now you should not have any kind of syntax error. In my case adding the dependency javax.servlet:jstl:1.2 didn't work. Adding the dependency jstl:jstl:1.2 worked.
Make sure that JSTL library jars are added to the module dependencies.
Add something like this to your pom.xml
under the <dependencies>
node (you are using maven, right?):
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>2.5</version>
</dependency>
For gradle and other build systems see https://mvnrepository.com/artifact/javax.servlet/servlet-api/2.5
Also, make sure you pick a suitable version for your project. To see all available versions check here.
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