I am new to JSP pages. I am trying to use core Tags and sql tags in JSP using JSTL. But somehow I am getting the following error.Error 500 on Compilation
My JSP file is as follows:
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
<title>Title</title>
</head>
<body>
<sql:setDataSource var="db" driver="com.mysql.cj.jdbc.Driver" url="jdbc:mysql://localhost:3306/advjava" user="root" password="${myPassword}"/>
<sql:query var="rs" dataSource="${db}">SELECT * FROM books</sql:query>
<c:forEach items="${rs.rows}" var="book">
<c:out value="${book.book_name}" /> | <c:out value="${book.author_name}"/> | <c:out value="${book.publisher_name}"/>
</c:forEach>
</body>
</html>
I have also added the dependency in my pom.xml
<dependency>
<groupId>org.glassfish.web</groupId>
<artifactId>jakarta.servlet.jsp.jstl</artifactId>
<version>3.0.1</version>
</dependency>
Also, I would like to know if JSTL is actually deprecated, because I am not able work with it that smoothly.
I am trying to fetch the data from my MySQL database using JSTL tags. It is supposed to list down the book names, along with their author names and publisher name. I am trying to run a loop over the fetched data and display the required data.