0

I am using Intellij Idea 2016.2.2 and Tomcat Server 8.0.27. I include taglib in jsp file at top as following:

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

When I depolyed in Tomcat and ran the code following error is generated.

HTTP Status 500 - The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application

type Exception report

message The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application

description The server encountered an internal error that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application
    org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:55)
    org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:277)
    org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:75)
    org.apache.jasper.compiler.TagLibraryInfoImpl.generateTldResourcePath(TagLibraryInfoImpl.java:243)
    org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:124)
    org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:416)
    org.apache.jasper.compiler.Parser.parseDirective(Parser.java:474)
    org.apache.jasper.compiler.Parser.parseElements(Parser.java:1430)
    org.apache.jasper.compiler.Parser.parse(Parser.java:139)
    org.apache.jasper.compiler.ParserController.doParse(ParserController.java:227)
    org.apache.jasper.compiler.ParserController.parse(ParserController.java:100)
    org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:199)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:356)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:336)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:323)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:585)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:363)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    com.himal.jdbcservlet.controller.CourseController.doPost(CourseController.java:46)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52

Then, I have read I have read https://www.jetbrains.com/help/idea/2016.2/configuring-module-dependencies-and-libraries.html

1) I added by following steps. ProjectStructure->Libraries->'+'From Java->JSTL jar location. After this that jar appears under external Libraries. But it doesn't work.

2) Then I found this link in stack overflow https://stackoverflow.com/a/32444393/6189499

I followed same procedure but doesn't work. How can I resolve this issue?

Community
  • 1
  • 1
Himal Acharya
  • 836
  • 4
  • 14
  • 24

2 Answers2

0
  1. Create a lib directorory under web/WEB-inf.

  2. Download jstl 1.2 jar from https://mvnrepository.com/artifact/jstl/jstl/1.2

  3. Go to Intellij -> Project Structure -> Artifacts -> Add lib directory contents.
  4. Rebuild Project and restart Tomcat.
0

Add:
javax.servlet.jsp.jstl-1.2.1.jar and
javax.servlet.jsp.jstl.jar
restart Tomcat and redeploy the project.

Sam Joos
  • 430
  • 2
  • 11
  • 25