Estou tomando essa exceção ao tentar listar as Empresas.
SEVERE: Servlet.service() for servlet [jsp] in context with path [/gerenciador] threw exception [java.lang.NoClassDefFoundError: javax/servlet/jsp/tagext/TagLibraryValidator] with root cause
java.lang.ClassNotFoundException: javax.servlet.jsp.tagext.TagLibraryValidator
Minha Classe lista empresas!
`
package br.com.zup.gerenciador.servlet;
import java.io.IOException; import java.util.List;
import br.com.zup.gerenciador.models.Company;
import br.com.zup.gerenciador.models.DataBase;
import jakarta.servlet.RequestDispatcher;
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
@WebServlet("/listCompanies") public class ListCompaniesServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
private DataBase DB = new DataBase();
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
List<Company> companies = DB.getCompanies();
request.setAttribute("companies", companies);
RequestDispatcher rd = request.getRequestDispatcher("/listCompanies.jsp");
rd.forward(request, response);
}
}`
Minha Pagina JSP
<%@ page import="java.util.List, br.com.zup.gerenciador.models.Company" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<ul>
<c:forEach items="${ companies }" var="company">
<li> <strong> ${ company } </strong> </li>
</c:forEach>
</ul>
``
Estou utilizando: Tomcar 10.0.2 Java JDK 15 Lib do link da aula de servlet!