Tester
Tester

Reputation: 1

Unable to use c:forEach in my Spring MVC application

I have a query in my basic Spring MVC application as below. I want to display the values from mysql database to my web application. For this, I'm using c:forEach in my .jsp file.

Note: I am using Tomcat 10.1.34. Also, I don't want to install additional .jar files.

I have attached the "showbus.jsp" file image for your reference.

Kindly assist me in displaying the data from the database to my webpage using the best possible way.

Scenario 1 I write

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

I get the following error:

jakarta.servlet.ServletException: java.lang.NoClassDefFoundError: jakarta/servlet/jsp/jstl/core/LoopTag

Scenario 2 I write

<%@ taglib prefix="c" uri="http://jakarta.ee/jsp/jstl/core"%>

I get the following error:

org.apache.jasper.JasperException: The absolute uri: [http://jakarta.ee/jsp/jstl/core] cannot be resolved in either web.xml or the jar files deployed with this application

Scenario 3 If I don't write any taglib specification, and c:forEach remains the same in the code, I am getting an empty table in web page.

Upvotes: 0

Views: 19

Answers (0)

Related Questions