How do I get the Dukes Bookstore servlet example at the Java Developer Connection to work under Servlet API version 2.2 (and Tomcat 3.1)?
Location: http://www.jguru.com/faq/view.jsp?EID=98986 Created: Jul 9, 2000 Modified: 2000-07-10 12:39:58.58 Author: Avi Kak (http://www.jguru.com/guru/viewbio.jsp?EID=26410) The Duke’s Bookstore example at the Java Developer Connection is indeed very instructive. As currently posted, this example works for JSDK 2.1. To get it to work under Tomcat 3.1, which uses the Servlet API 2.2, you’d need to make the following changes: In the override definitions of the doGet(HttpServletRequest, HttpServletResponse) method in the files CatalogServlet.java, ShowCartServlet.java, Cashier.servlet, BookDetailServlet.java, and in the override definition of the doPost(HttpServletRequest, HttpServletResponse) method in the file ReceiptServlet.java, replace the invocation ShoppingCart cart = (ShoppingCart)session.getValue(session.getId()); by ShoppingCart cart = (ShoppingCart)session.getAttribute(session.getId()); and the invocation session.putValue(session.getId(), cart); by session.setAttribute(session.
Related Questions
- How do I get the Dukes Bookstore servlet example at the Java Developer Connection to work under Servlet API version 2.2 (and Tomcat 3.1)?
- For the servlet layer on the web server, what version of the Java Servlet API are the PIA Java Servlets coded to with PeopleTools 8.4?
- what version of the Java Servlet API are the PIA Java Servlets coded to with PeopleTools 8.4?