I want to create a new ServletContext in a servlet.java file that stores items from an arrayList in another servlet file. Then I want to display this list of items in the ServletContext on a JSP page. How can I accomplice this? I tried this for my Servlet to save the items in the context:
ServletContext application = this.getServletContext();
String path = application.getRealPath("E:/books.txt");
application.setAttribute("items", ELoan.getItem(path));
But this does not seem to be working. I am just learning JSP, any clarification would be great.
Thank You