Prentice Hall and Sun Microsystems. Personal use only; do not redistribute.
218
Chapter 9 Session Tracking
Listing 9.5 OrderPage.java (continued)
        // Put number ordered in textfield that user
        // can change, with "Update Order" button next
        // to it, which resubmits to this same page
        // but specifying a different number of items.
        for(int i=0; i
          order = (ItemOrder)itemsOrdered.elementAt(i);
          out.println
            ("\n" +
             "  " + order.getItemID() + "\n" +
             "  " + order.getShortDescription() + "\n" +
             "  " +
             formatter.format(order.getUnitCost()) + "\n" +
             "  " +
             "
\n" +
             "
             "       VALUE=\"" + order.getItemID() + "\">\n" +
             "
             "       SIZE=3 VALUE=\"" + 
             order.getNumItems() + "\">\n" +
             "\n" +
             "
             "       VALUE=\"Update Order\">\n" +
             "\n" +
             "\n" +
             "  " +
             formatter.format(order.getTotalCost()));
        }
        String checkoutURL =
          response.encodeURL("/Checkout.html");
        // "Proceed to Checkout" button below table
        out.println
          ("\n" +
           "
\n" +
           "
\n" +
           "
           "       VALUE=\"Proceed to Checkout\">\n" +
           "");
      }
      out.println("");
    }
  }
  /** POST and GET requests handled identically. */
  
  public void doPost(HttpServletRequest request,
                     HttpServletResponse response)
      throws ServletException, IOException {
    doGet(request, response);
  }
}
Second edition of this book: www.coreservlets.com; Sequel: www.moreservlets.com.
Servlet and JSP training courses by book's author: courses.coreservlets.com.






footer




 

 

 

 

 Home | About Us | Network | Services | Support | FAQ | Control Panel | Order Online | Sitemap | Contact

jsp web hosting

 

Our partners: PHP: Hypertext Preprocessor Best Web Hosting Java Web Hosting Jsp Web Hosting Cheapest Web Hosting

Visionwebhosting.net Business web hosting division of Web Design Plus. All rights reserved