E
E
Evgeny Petryaev2018-11-18 04:02:24
Java
Evgeny Petryaev, 2018-11-18 04:02:24

Connecting jstl to jsp file?

I downloaded the fire jstl file, I use it in such a jsp file

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Products</title>
</head>
<body>
<h2>Users List</h2>
<p><a href='<c:url value="/create" />'>Create new</a></p>
<table>
<tr><th>NickName</th><th>Password</th><th>email</th></tr>
<c:forEach var="product" items="${products}">
 <tr><td>${users.nickname}</td>
    <td>${users.password}</td>
    <td>${users.email}</td>
    <td>
    <a href='<c:url value="/edit?id=${users.id}" />'>Edit</a> |
    <form method="post" action='<c:url value="/delete" />' style="display:inline;">
        <input type="hidden" name="id" value="${users.id}">
        <input type="submit" value="Delete">
    </form>
 </td></tr>
</c:forEach>
</table>
</body>
</html>

I get an error when I open this jsp file
HTTP Status 500 – Internal Server Error
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 unexpected condition that prevented it from fulfilling the 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:293)
  org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:80)
  org.apache.jasper.compiler.TagLibraryInfoImpl.generateTldResourcePath(TagLibraryInfoImpl.java:251)
  org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:122)
  org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:434)
  org.apache.jasper.compiler.Parser.parseDirective(Parser.java:492)
  org.apache.jasper.compiler.Parser.parseElements(Parser.java:1448)
  org.apache.jasper.compiler.Parser.parse(Parser.java:145)
  org.apache.jasper.compiler.ParserController.doParse(ParserController.java:244)
  org.apache.jasper.compiler.ParserController.parse(ParserController.java:105)
  org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:203)
  org.apache.jasper.compiler.Compiler.compile(Compiler.java:374)
  org.apache.jasper.compiler.Compiler.compile(Compiler.java:351)
  org.apache.jasper.compiler.Compiler.compile(Compiler.java:335)
  org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:601)
  org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:368)
  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:385)
  org.apache.jasper.servlet.JspServlet.service(JspServlet.java:329)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
  org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
Note The full stack trace of the root cause is available in the server logs.

Apache Tomcat/8.5.23

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Ruslan Lopatin, 2018-11-19
@lorus

jstl library must be included

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question