Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

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)?

0
Posted

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)?

0

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

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123