0

При переходе на JSP страницу, которая использует JSTL получаю ошибку:

введите сюда описание изображения

dependency в pom.xml:

<dependency>
   <groupId>jstl</groupId>
   <artifactId>jstl</artifactId>
   <version>1.2</version>
</dependency>

(<groupId>javax.servlet</groupId> так же не работает)

JSP страница:

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Error</title>
    <style><%@ include file="/frontend/style/style.css"%></style>
</head>
<body>

<section class="error">
    <div class="error__img"><img src="${pageContext.request.contextPath}/frontend/images/error.png" alt=""></div>
    <p class='error__sorry'><c:out value="We are very sorry"/></p>
    <form action="hotel" method="post" class="error__back">
        <button type="submit" name="command" value="toMainPage">Back to main page</button>
    </form>
</section>
</body>
</html>

Структура проекта, если это важно:

введите сюда описание изображения

1
  • Нужно смотреть лог сервера.
    – Roman C
    10 июн 2021 в 18:00

1 ответ 1

0

Нашел решение. Для apache tomcat версии 10 (возможно когда вы это смотрите уже версии >10) нужно использовать

<dependency>
    <groupId>org.glassfish.web</groupId>
    <artifactId>jakarta.servlet.jsp.jstl</artifactId>
    <version>2.0.0</version>
</dependency>

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.