Inhaltsverzeichnis der JSP Seiten:

HTML:
HTML Welcome Seite
HTML Order Seite
HTML Finish Seite
HTML Regiestration Seite

WML:
WML Welcome Seite

 

HTML JSP Pages

·         Welcome Seite

 
    <!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0 Transitional//EN'>
 
    <html>
        <head>
               <title>Welcome Site</title>
        </head>
    
        <%@ page contentType="text/html" %>
 
        <body>
 
               <%-- Imports for the Page --%>
               <%@ page import="com.bookshop.logic.Book,
                                  java.util.Enumeration,
                                  java.util.Vector,
                                  com.bookshop.logic.JSPHelper"%> 
 
               
    
               <%-- Variable for this page --%>
               <% String encodedUrl = JSPHelper.getBaseUrl(request, response);
                      Vector booklist = (Vector) request.getAttribute("booklist");%>
 
               <p>
    
                       <h><b> BOOKS TO ORDER  </b></h><br>
    
                       <!-- Header of the table for books to order -->
    
                       <table border=2 cellspacing=2 cellpadding=2>
                       <tr><th>ISBN<\th><th>Author</th><th>Title</th><th>Ordered</th>
                       </tr>
 
                       <!-- Add Items to books list -->
                       <%
                               Book b;
                               for (Enumeration e = booklist.elements() ; e.hasMoreElements() ;) 
                               {
                                      b = (Book) e.nextElement();
                                      out.println("<tr><td>" + b.getISBN() + "</td>"+
                                                     "<td>" + b.getAutor() + "</td>"+
                                                     "<td>" + b.getTitle() + "</td><td>"+
                                                     "<form action = '" + encodedUrl + "' method='post'>"+
                                                      "<input type='text' name='countage' maxlength='3' size='3'>"+
                                                     "<input type='hidden' name='isbn' value='" + b.getISBN() + "'>"+
                                                     "<input type='hidden' name='next' value='update'>"+
                                                     "<input type='submit' name='update' value='update'>"+
                                                     "</form>"+
                                                     "</td></tr>" );
                               }
                       %>
                       </table><br><br>
               </p>
        </body>
</html>
 
zurück zum Anfang    

·         Order Status

 
<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0 Transitional//EN'>
 
<html>
        <head>
               <title> Welcome Site </title>
        </head>
 
        <%@ page contentType="text/html" %>
        <%-- Imports for the Page --%>
        <%@ page import="com.bookshop.logic.Book,
                        com.bookshop.logic.Order,
                        java.util.Enumeration,
                         java.util.Vector,
                         com.bookshop.logic.JSPHelper"%> 
               
        <%-- Variable for this page --%>
        <% String encodeUrl = JSPHelper.getBaseUrl(request, response);
           Vector orderList = (Vector) session.getValue("OrderList");%>
        
        <body>
 
               <p>
               <%@ include file="Booklist.jsp" %>
               <h><b> STATUS OF YOUR ORDER </b></h><br>
               
               <!-- Header of the table for books to order -->
               <table border=2 cellspacing=2 cellpadding=2>
                <tr>
                    <th>Countage</th><th>ISBN</th><th>Author</th><th>Title</th><th>Ordered</th>
                </tr>
               <!-- Add Items to books list -->      
               <%
                       Book book;
                       Order o;
                       for (Enumeration e = orderList.elements() ; e.hasMoreElements() ;) 
                       {
                               o = (Order) e.nextElement();
                               book = o.getBook();
                               out.println("<tr><td>"+ o.getCountage() + 
                                          "</td><td>"+ o.getISBN() + 
                                          "</td><td>" + book.getAutor() + 
                                          "</td><td>" + book.getTitle() + 
                                          "</td><td>"+
                               "<form action = '" + encodeUrl + "' method='post'>"+
                               "<input type='hidden' name='isbn' value='" + o.getISBN() + "'>"+
                               "<input type='hidden' name='next' value='delete'>" +
                               "<input type='submit' name='delete' value='delete'>"+
                               "</form>"+
                               "</td></tr>" );
                       }       
               %>
               </table><br><br>
               <form action = '<%= encodeUrl %>' method='post'>
                        <input type='submit' name='Order' value='order'>
                        <input type='hidden' name='next' value='order'>
                </form>
                       
               </p>
        </body>
</html>
 
zurück zum Anfang         
    

·         Finish

 
<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0 Transitional//EN'>
 
<html>
        <head>
               <title> Order Site </title>
        </head>
        <%@ page contentType="text/html" %>
        <%-- Imports for the Page --%>
        <%@ page import="com.bookshop.logic.*,
                        java.util.Enumeration,
                         java.util.Vector"%> 
               
               
        <%-- Variable for this page --%>
        <% String encodedUrl = JSPHelper.getBaseUrl(request, response);
           Vector orderList = (Vector) session.getValue("OrderList");%>
        
        <body>
               <p>
               <h><b> ORDER </b></h>
               <br>
               
               Order ID: <%= ((Integer)session.getValue("OrderID")).intValue() %> <br>
               Date of Order: <%= new java.util.Date() %> <br>
               <br>
               <% User u = (User) session.getValue("user"); %>
               
               Member ID: <%= u.getUserID() %> <br>
               Last Name: <%= u.getLName()  %> <br>
               First Name:<%= u.getFName()  %> <br>
               Address:   <%= u.getAddress()%> <br>
               ZipCode:   <%= u.getZipCode()%> <br>
               
               
               <!-- Header of the table for books to order -->
               
               <table border=2 cellspacing=2 cellpadding=2>
                       <tr><th>Countage</th><th>ISBN</th><th>Author</th><th>Title</th></tr>
               
               <!-- Show Items of Order -->
               
               <%
                       Book b;
                       Order o;
                       for (Enumeration e = orderList.elements() ; e.hasMoreElements() ;) 
                       {
                               o = (Order) e.nextElement();
                               b = o.getBook();
                               out.println("<tr><td>"+ o.getCountage() +"</td>"+ 
                                              "<td>"+ b.getISBN()     +"</td>"+
                                              "<td>" + b.getAutor()   +"</td>"+
                                              "<td>" + b.getTitle()   +"</td>"+
                                         "</tr>" );
                       }
               %>      
               </table><br><br>
                       
               <form action = '<%= encodedUrl %>' method='post'>
                        <input type='submit' name='backToMain' value='Back To Main'>
                </form>        
               </p>
        </body>
</html>
 
zurück zum Anfang
    

·         Registration

 
 
<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0 Transitional//EN'>
 
<html>
        <head>
               <title> Order and Registration Site </title>
        </head>
                <%-- Imports for the Page --%>
               <%@ page import="com.bookshop.logic.JSPHelper"%> 
        
               <%-- Variable for this page --%>
               <% String encodeUrl = JSPHelper.getBaseUrl(request, response);%>     
        <body>
               <h><b>ORDER AND REGISTRATION </b></h>
                <form action = '<%= encodeUrl %>' method='post'>
                       UserID:     <input type='text' name='userID' ><br>
                        First Name: <input type='text' name='fname' ><br>
                        Last Name:  <input type='text' name='lname' ><br>
                        Address:    <input type='text' name='address'><br>
                        ZipCode:    <input type='text' name='zipcode' ><br>
                        <input type='submit' name='Order' value='order'>
                        <input type='hidden' name='next' value='ordandreg'>
                 </form>
        </body>
</html>
 
zurück zum Anfang 

WML JSP Pages

·         Welcome Seite

 
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
 
<%@ page contentType="text/vnd.wap.wml" %>
<wml>
        <head>
               <meta http-equiv="Cache-Control" content="0" />
        </head>
 
        <%-- Imports for the Page --%>
        <%@ page import="com.bookshop.logic.Book,
                          java.util.Enumeration,
                           java.util.Vector,
                           com.bookshop.logic.JSPHelper"%> 
               
        <%-- Variable for this page --%>
        <% String encodedUrl = JSPHelper.getBaseUrl(request, response);
           Vector booklist = (Vector) request.getAttribute("booklist");%>
        <!-- Add Items to books list -->      
        <%
               Book b;
               int i=0;
               for (Enumeration e = booklist.elements() ; e.hasMoreElements() ;) 
               {
                       b = (Book) e.nextElement();
                       out.println("<card id='Book_" + i +"'>"+
                                      "<p><do type='accept' label='Next'>"+
                                              "<go href='#Book_"+ (i+1) + "'/>"+
                                      "</do>"+
                                          "ISBN: " + b.getISBN() + "<br/>"+
                                          "Author: " + b.getAutor() + "<br/>"+
                                          "Title: " + b.getTitle() + "<br/>"+
                                          "Order: <input type='text' name='countage' emptyok='true' maxlength='3' />"+
                                      "<anchor title='Order'>"+
                                             "<go href='" + encodedUrl +"&next=update&"+JSPHelper.URLRewriter() + "' method='post'>" +
                                                " <postfield name='countage' value='$countage' /> " +
                                                " <postfield name='isbn' value='$isbn' /> " +
                                             "</go> "+
                                      "</anchor>"+ 
                                      "</p>"+
                                      "</card>");
                                      i++;
               }
        %>
</wml>
 
zurück zum Anfang
               
Man sieht anhand dieser Beispiele wie die Implementierung ausschauen könnte, dies ist nicht
die vollständige Implementierung, jedoch ist sie aufgrund dieses Ansatzes hier, leicht fertig zu stellen.