Package util

Examples of util.Currency


         
         try {
               Collection coll = bookDB.getBooks();

               Iterator i = coll.iterator();
               Currency c = (Currency)session.getAttribute("currency");
               if (c == null) {
                  c = new Currency();
                  c.setLocale(request.getLocale());
                  session.setAttribute("currency", c);
               }
               while (i.hasNext()) {
                     BookDetails book = (BookDetails)i.next();
                     bookId = book.getBookId();
                     c.setAmount(book.getPrice());
     
               //Print out info on each book in its own two rows
               out.println("<tr>" +

                           "<td bgcolor=\"#ffffaa\">" +
                           "<a href=\"" +
                           response.encodeURL(request.getContextPath() + "/bookdetails?bookId=" + bookId) +
                           "\"> <strong>" + book.getTitle() +
                           "&nbsp; </strong></a></td>" +

                           "<td bgcolor=\"#ffffaa\" rowspan=2>" +
                           c.getFormat() +
                           "&nbsp; </td>" +

                           "<td bgcolor=\"#ffffaa\" rowspan=2>" +
                           "<a href=\"" +
                           response.encodeURL(request.getContextPath() + "/bookcatalog?bookId=" + bookId)
View Full Code Here


        }
       
   // set content-type header before accessing Writer
      response.setContentType("text/html");
      PrintWriter out = response.getWriter();
      Currency c = (Currency)session.getAttribute("currency");
      if (c == null) {
         c = new Currency();
         c.setLocale(request.getLocale());
         session.setAttribute("currency", c);
      }
      c.setAmount(cart.getTotal());

   // then write the data of the response
        out.println("<html>" +
                    "<head><title>" + messages.getString("TitleCashier") + "</title></head>");

        // Get the dispatcher; it gets the banner to the user
        RequestDispatcher dispatcher =
               getServletContext().getRequestDispatcher("/banner");
                                      
            if (dispatcher != null)
               dispatcher.include(request, response);
              
       // Print out the total and the form for the user
        out.println("<p>" + messages.getString("Amount") +
                    "<strong>" + c.getFormat() + "</strong>" +
                    "<p>" + messages.getString("Purchase") +
                    "<form action=\"" +
                    response.encodeURL(request.getContextPath() + "/bookreceipt") +
                    "\" method=\"post\">" +
                    "<table summary=\"layout\">" +
View Full Code Here

TOP

Related Classes of util.Currency

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.