0

Error

An error occurred at line: 18 in the jsp file: /BookStoreHome.jsp
title cannot be resolved or is not a field
15: <% 
16: ArrayList<Book> book_list = (ArrayList<Book>)session.getAttribute("books"); 
17: for (int i = 0; i < book_list.size(); i++) {%>
18: <%= book_list.get(i).title %>,
19: <% } %>
20: 
21: </body>


First I am setting the books as an ArrayList and storing in a session.
User Logic Class

ArrayList<Book> book_list = bsl.selectBooks();
session.setAttribute("books", book_list);

Book Class

public class Book {

    public String isbn;
    public String title;
    public double price;
    public String genre;
    public int format;
    public String publisher;
    public int publisherYear;
    public int count;
    public String author;
    public String date;


    public Book(String _isbn, String _title, double _price, String _genre, int _format, 
            String _publisher, int _publisheryear, int _count, String _author){
        title = _title;
        isbn = _isbn;
        price = _price;
        genre = _genre;
        format = _format;
        publisher = _publisher;
        publisherYear = _publisheryear;
        count = _count;
        author = _author;
    }
Infinite Recursion
  • 6,511
  • 28
  • 39
  • 51
AustinT
  • 1,998
  • 8
  • 40
  • 63

0 Answers0