Java – spring MVC – unable to compile classes for JSP

I'm following the spring MVC course of virtualpairprogrammers. There seems to be some problems with the workspace they provide The following error occurred while running the code

What's wrong? This is the code in my controller:

@RequestMapping("/viewAllBooks")
public ModelAndView viewAllBooks()
{
    List<Book> allBooks = bookService.getEntireCatalogue();
    return new ModelAndView("/displayAllBooks.jsp","allBooks",allBooks);
}

This is a JSP file:

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


<html>
<head>
    <title>All books for our store</title>
    <link href="styles.css" rel="Stylesheet" type="text/css"/>
</head>

<body>

    <jsp:include page="/web/header.jsp"/>

    <div id="books">
        <ul>
            <c:forEach items="${allBooks}" var="nextBook">

            <li>
                <h2>${nextBook.title}</h2>
                <p>
                    <span> by  ${nextBook.author}  
                           <fmt:formatNumber value="${nextBook.price}"
                                             type="currency"
                                             currencyCode="USD" />          

                    <form method='post' action='<c:url value=""/>'>
                        <input type='hidden' name='id' value='${nextBook.id}'/>
                        <input type='image' src='cart-button.png'/>
                    </form>
                </span>
                </p>

            </li>

            </c:forEach>

        </ul>
    </div>

    <jsp:include page="/web/footer.jsp"/>

</body>

</html>

Solution

I designed the course, so I should be able to help We have provided a copy of the latest Tomcat at the time of recording, which has been for several years However, Java 8 is interrupted on this version It should be a simple case of running code on Tomcat 8

I will contact you through virtualpairprogrammers. When we sort out the version mismatch, we will update the course to use Tomcat 8

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>