]> git.mxchange.org Git - pizzaservice-war.git/commitdiff
Continued:
authorRoland Haeder <roland@mxchange.org>
Tue, 11 Aug 2015 11:09:47 +0000 (13:09 +0200)
committerRoland Haeder <roland@mxchange.org>
Tue, 11 Aug 2015 11:09:47 +0000 (13:09 +0200)
- Moved login/register to own path /customer/
- Added "static" include "login_form.jsp" and "gender_selection_box.jsp"
- Added form handler "do_preview.jsp" and moved code from preview.jsp to it
- style.css should be referenced with full path so all pages can have same HTML code
Signed-off-by:Roland Häder <roland@mxchange.org>

15 files changed:
web/bye.jsp
web/customer/login.jsp [new file with mode: 0644]
web/customer/register.jsp [new file with mode: 0644]
web/errorHandler.jsp
web/finished.jsp
web/form_handler/do_order.jsp
web/form_handler/do_preview.jsp [new file with mode: 0644]
web/index.jsp
web/login.jsp [deleted file]
web/preview.jsp
web/register.jsp [deleted file]
web/static/forms/login.jsp [new file with mode: 0644]
web/static/gender_selection_box.jsp [new file with mode: 0644]
web/static/menu.jsp
web/style.css

index b4a152f1066636b292e3efc0943eaa238cd4d440..678c9da9b4103894e5e435f1b3a9536304616fc0 100644 (file)
@@ -11,7 +11,7 @@
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
        <head>
                <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-               <link rel="stylesheet" href="style.css" type="text/css"/>
+               <link rel="stylesheet" href="<%=request.getContextPath()%>/style.css" type="text/css"/>
                <title><%=PizzaServiceApplication.MAIN_TITLE%> - Sitzung beenden</title>
        </head>
 
diff --git a/web/customer/login.jsp b/web/customer/login.jsp
new file mode 100644 (file)
index 0000000..9005179
--- /dev/null
@@ -0,0 +1,45 @@
+<%-- 
+       Document   : login
+       Created on : 11.08.2015, 11:35:53
+       Author     : Roland Haeder
+--%>
+
+<%@page contentType="text/html" pageEncoding="UTF-8"%>
+<%@page import="org.mxchange.pizzaapplication.application.PizzaServiceApplication"%>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
+       <head>
+               <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+               <link rel="stylesheet" href="<%=request.getContextPath()%>/style.css" type="text/css"/>
+               <title><%=PizzaServiceApplication.MAIN_TITLE%> - Einloggen</title>
+       </head>
+
+       <body>
+               <div id="title">
+                       <h1><%=PizzaServiceApplication.MAIN_TITLE%> - Einloggen</h1>
+               </div>
+
+               <jsp:include page="/static/menu.jsp" flush="true" />
+
+               <div id="content_outer">
+                       <div id="content_title">
+                               <h2>Einloggen als bestehender Kunde:</h2>
+                       </div>
+
+                       <div id="content">
+                               <div class="para">
+                                       Noch kein Kunde? Einfach beim Bestellen anmelden oder <a href="<%=request.getContextPath()%>/register.jsp">hier</a> anmelden.
+                               </div>
+
+                               <div class="para">
+                                       <jsp:include page="/static/forms/login.jsp" flush="true" />
+                               </div>
+
+                               <div class="para">
+                                       <a href="<%=request.getContextPath()%>/lost_passwd.jsp">Passwort vergessen?</a>
+                               </div>
+                       </div>
+               </div>
+       </body>
+</html>
diff --git a/web/customer/register.jsp b/web/customer/register.jsp
new file mode 100644 (file)
index 0000000..c70d379
--- /dev/null
@@ -0,0 +1,50 @@
+<%-- 
+       Document   : register
+       Created on : 11.08.2015, 11:56:22
+       Author     : Roland Haeder
+--%>
+
+<%@page contentType="text/html" pageEncoding="UTF-8"%>
+<%@page import="org.mxchange.pizzaapplication.application.PizzaServiceApplication"%>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
+       <head>
+               <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+               <link rel="stylesheet" href="<%=request.getContextPath()%>/style.css" type="text/css"/>
+               <title><%=PizzaServiceApplication.MAIN_TITLE%> - Neukunde</title>
+       </head>
+
+       <body>
+               <div id="title">
+                       <h1><%=PizzaServiceApplication.MAIN_TITLE%> - Neukunde</h1>
+               </div>
+
+               <jsp:include page="/static/menu.jsp" flush="true" />
+
+               <div id="content_outer">
+                       <div id="content_title">
+                               <h2>Anmelden zum <%=PizzaServiceApplication.MAIN_TITLE%>:</h2>
+                       </div>
+
+                       <div id="content">
+                               <div>
+                                       Sie sind bereits Kunde? Dann <a href="<%=request.getContextPath()%>/login.jsp">hier</a> einloggen.
+                               </div>
+
+                               <form action="<%=request.getContextPath()%>/form_handler/do_register.jsp" accept-charset="utf-8" id="form" method="post">
+                                       <div class="table">
+                                               <div class="table_header">
+                                                       Bitte geben Sie mindestens Name, Anschrift und Telefonnummer ein:
+                                               </div>
+
+                                               <div class="table_footer">
+                                                       <input type="reset" value="Formular zurücksetzen" />
+                                                       <input type="submit" name="send" value="Anmelden" />
+                                               </div>
+                                       </div>
+                               </form>
+                       </div>
+               </div>
+       </body>
+</html>
index 8fe26c1b83ce840418e69e14c46ab95954afc7a8..21a892fd52f08ecce91fafc5349edba0cea01287 100644 (file)
@@ -19,7 +19,7 @@
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
        <head>
                <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-               <link rel="stylesheet" href="style.css" type="text/css"/>
+               <link rel="stylesheet" href="<%=request.getContextPath()%>/style.css" type="text/css"/>
                <title><%=PizzaServiceApplication.MAIN_TITLE%> - Fehler</title>
        </head>
 
index 13195b2afb9b47c47cc8f50d1d9e85263f8444cf..3788ba18b2854b198f63291f4f70496ae27fd5a8 100644 (file)
@@ -26,7 +26,7 @@
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
        <head>
                <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-               <link rel="stylesheet" href="style.css" type="text/css"/>
+               <link rel="stylesheet" href="<%=request.getContextPath()%>/style.css" type="text/css"/>
                <title><%=PizzaServiceApplication.MAIN_TITLE%> - Vielen Dank!</title>
        </head>
 
index 79e7c5e1a7e9f0bf6c1d2b3d7c411554079753a9..cdfe1c37724e66517a9c71183fd24ec1705079de 100644 (file)
@@ -32,7 +32,7 @@
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
        <head>
                <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-               <link rel="stylesheet" href="style.css" type="text/css"/>
+               <link rel="stylesheet" href="<%=request.getContextPath()%>/style.css" type="text/css"/>
                <title><%=PizzaServiceApplication.MAIN_TITLE%> - Form-Handler</title>
        </head>
 
diff --git a/web/form_handler/do_preview.jsp b/web/form_handler/do_preview.jsp
new file mode 100644 (file)
index 0000000..9327d52
--- /dev/null
@@ -0,0 +1,66 @@
+<%-- 
+       Document   : order
+       Created on : 04.08.2015, 10:55:10
+       Author     : Roland Haeder
+--%>
+
+<%--<%@page errorPage="errorHandler.jsp" %>--%>
+<%@page import="java.util.Iterator"%>
+<%@page import="java.util.Map"%>
+<%@page import="org.mxchange.jcore.contact.Gender"%>
+<%@page import="org.mxchange.pizzaapplication.product.Product"%>
+<%@page import="org.mxchange.pizzaapplication.application.PizzaApplication"%>
+<%@page import="org.mxchange.pizzaapplication.application.PizzaServiceApplication"%>
+<%@page import="org.mxchange.pizzaapplication.beans.CustomerBean" %>
+<%@page contentType="text/html" pageEncoding="UTF-8"%>
+
+<%
+       // Init application instance
+       PizzaApplication app = PizzaServiceApplication.getInstance(application);
+
+       // Is it post?
+       if ("POST".equals(request.getMethod())) { //NOI18N
+               // "Walk" through all products and unmark them as ordered
+               for (final Product product : app.getUnmarkedProducts(session)) {
+                       // Is it choosen and amount set?
+                       if (app.isProductChoosen(product, request, session)) {
+                               // Then mark it as choosen
+                               app.markProductAsChoosen(product, session);
+                       }
+               }
+               // Redirect to proper URL
+               // @TODO Commented out for developing:
+               //response.sendRedirect(request.getContextPath() + "/finished.jsp");
+%>
+<jsp:useBean id="customer" scope="session" class="org.mxchange.pizzaapplication.customer.bean.PizzaServiceCustomerBean" type="CustomerBean" />
+<jsp:setProperty name="customer" property="*" />
+<jsp:forward page="../preview.jsp" />
+<%
+       }
+%>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
+       <head>
+               <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+               <link rel="stylesheet" href="<%=request.getContextPath()%>/style.css" type="text/css"/>
+               <title><%=PizzaServiceApplication.MAIN_TITLE%> - Form-Handler</title>
+       </head>
+
+       <body>
+               <div id="title">
+                       <h1><%=PizzaServiceApplication.MAIN_TITLE%> - Form-Handler</h1>
+               </div>
+
+               <jsp:include page="/static/menu.jsp" flush="true" />
+
+               <div id="content_outer">
+                       <div id="content_title">
+                               <h2>Bitte nicht direkt aufrufen:</h2>
+                       </div>
+
+                       <div id="content">
+                               Bitte rufen Sie diese Seite nicht direkt auf.
+                       </div>
+               </div>
+       </body>
+</html>
index ab34c0855e7447ec68707603b4d1cdbb420604cd..ffc06eb0183e5ce7c19386758fa1bd4b6fad1f87 100644 (file)
@@ -20,7 +20,7 @@
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
        <head>
                <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-               <link rel="stylesheet" href="style.css" type="text/css"/>
+               <link rel="stylesheet" href="<%=request.getContextPath()%>/style.css" type="text/css"/>
                <title><%=PizzaServiceApplication.MAIN_TITLE%> - Eingangsseite</title>
        </head>
 
@@ -37,7 +37,7 @@
                        </div>
 
                        <div id="content">
-                               <form action="<%=request.getContextPath()%>/preview.jsp" accept-charset="utf-8" id="form" method="post">
+                               <form action="<%=request.getContextPath()%>/form_handler/do_preview.jsp" accept-charset="utf-8" id="form" method="post">
                                <table class="table">
                                        <thead class="table_header">
                                                <tr>
diff --git a/web/login.jsp b/web/login.jsp
deleted file mode 100644 (file)
index 8d418c2..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-<%-- 
-    Document   : login
-    Created on : 11.08.2015, 11:35:53
-    Author     : Roland Haeder
---%>
-
-<%@page contentType="text/html" pageEncoding="UTF-8"%>
-<%@page import="org.mxchange.pizzaapplication.application.PizzaServiceApplication"%>
-
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
-       <head>
-               <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-               <link rel="stylesheet" href="style.css" type="text/css"/>
-               <title><%=PizzaServiceApplication.MAIN_TITLE%> - Einloggen</title>
-       </head>
-
-       <body>
-               <div id="title">
-                       <h1><%=PizzaServiceApplication.MAIN_TITLE%> - Einloggen</h1>
-               </div>
-
-               <jsp:include page="/static/menu.jsp" flush="true" />
-
-               <div id="content_outer">
-                       <div id="content_title">
-                               <h2>Einloggen als bestehender Kunde:</h2>
-                       </div>
-
-                       <div id="content">
-                               <div>
-                                       Noch kein Kunde? Einfach beim Bestellen anmelden oder <a href="<%=request.getContextPath()%>/register.jsp">hier</a> anmelden.
-                               </div>
-
-                               <form action="<%=request.getContextPath()%>/form_handler/do_login.jsp" accept-charset="utf-8" id="form" method="post">
-                                       <div class="table">
-                                               <div class="table_header">
-                                                       Bitte geben Sie Ihre Kundennummer und Passwort ein:
-                                               </div>
-
-                                               <fieldset id="login_data">
-                                                       <legend title="Bitte Daten eingeben:">Bitte Daten eingeben:</legend>
-
-                                                       <div class="table_row">
-                                                               <div class="data_left">
-                                                                       Kundennummer:
-                                                               </div>
-                                                               <div class="data_right">
-                                                                       <input type="text" name="id" size="10" maxlength="20" />
-                                                               </div>
-                                                       </div>
-
-                                                       <div class="clear"></div>
-
-                                                       <div class="table_row">
-                                                               <div class="data_left">
-                                                                       Passwort:
-                                                               </div>
-                                                               <div class="data_right">
-                                                                       <input type="password" name="password" size="10" maxlength="255" />
-                                                               </div>
-                                                       </div>
-
-                                                       <div class="clear"></div>
-                                               </fieldset>
-
-                                               <div class="table_footer">
-                                                       <input type="reset" value="Formular zurücksetzen" />
-                                                       <input type="submit" name="send" value="Einloggen" />
-                                               </div>
-                                       </div>
-                               </form>
-                       </div>
-               </div>
-       </body>
-</html>
index 62a3dad045bf9b1cb8c897355d001c4252fb7674..dbe8eb8ef73bed6392bfb728188c6a465e95271f 100644 (file)
@@ -25,7 +25,7 @@
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
        <head>
                <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-               <link rel="stylesheet" href="style.css" type="text/css"/>
+               <link rel="stylesheet" href="<%=request.getContextPath()%>/style.css" type="text/css"/>
                <title><%=PizzaServiceApplication.MAIN_TITLE%> - Bestellung anzeigen</title>
        </head>
 
                                                                                </div>
 
                                                                                <div class="data_right">
-                                                                                       <select name="gender" id="gender" size="1" <%=app.getDisabledHtmlFromSession(request, session)%>>
-                                                                                               <%
-                                                                                               // "Walk" through all genders and output them
-                                                                                               for (final Gender gender : Gender.values()) {
-                                                                                                       %>
-                                                                                                       <option value="<%=gender.name()%>"<%
-                                                                                                       // Get gender from bean
-                                                                                                       Gender value=  customer.getGender();
-
-                                                                                                       // Test it
-                                                                                                       if (value.equals(gender)) {
-                                                                                                               // Output selected="selected"
-                                                                                                               out.print("selected=\"selected\"");
-                                                                                                       }
-                                                                                                       %>><%=gender%></option>
-                                                                                                       <%
-                                                                                               }
-                                                                                               %> 
-                                                                                       </select>
+                                                                                       <jsp:include page="/static/gender_selection_box.jsp" flush="true" />
                                                                                </div>
 
                                                                                <div class="clear"></div>
diff --git a/web/register.jsp b/web/register.jsp
deleted file mode 100644 (file)
index 37d6589..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-<%-- 
-    Document   : register
-    Created on : 11.08.2015, 11:56:22
-    Author     : Roland Haeder
---%>
-
-<%@page contentType="text/html" pageEncoding="UTF-8"%>
-<%@page import="org.mxchange.pizzaapplication.application.PizzaServiceApplication"%>
-
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
-       <head>
-               <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-               <link rel="stylesheet" href="style.css" type="text/css"/>
-               <title><%=PizzaServiceApplication.MAIN_TITLE%> - Neukunde</title>
-       </head>
-
-       <body>
-               <div id="title">
-                       <h1><%=PizzaServiceApplication.MAIN_TITLE%> - Neukunde</h1>
-               </div>
-
-               <jsp:include page="/static/menu.jsp" flush="true" />
-
-               <div id="content_outer">
-                       <div id="content_title">
-                               <h2>Einloggen als bestehender Kunde:</h2>
-                       </div>
-
-                       <div id="content">
-                               <div>
-                                       Sie sind bereits Kunde? Dann <a href="<%=request.getContextPath()%>/login.jsp">hier</a> einloggen.
-                               </div>
-
-                               <form action="<%=request.getContextPath()%>/form_handler/do_register.jsp" accept-charset="utf-8" id="form" method="post">
-                                       <div class="table">
-                                               <div class="table_header">
-                                                       Bitte geben Sie mindestens Name, Anschrift und Telefonnummer ein:
-                                               </div>
-
-                                               <div class="table_footer">
-                                                       <input type="reset" value="Formular zurücksetzen" />
-                                                       <input type="submit" name="send" value="Anmelden" />
-                                               </div>
-                                       </div>
-                               </form>
-                       </div>
-               </div>
-       </body>
-</html>
diff --git a/web/static/forms/login.jsp b/web/static/forms/login.jsp
new file mode 100644 (file)
index 0000000..2276d93
--- /dev/null
@@ -0,0 +1,46 @@
+<%-- 
+       Document   : login
+       Created on : 11.08.2015, 12:28:03
+       Author     : Roland Haeder
+--%>
+<div id="login_form">
+       <form action="<%=request.getContextPath()%>/form_handler/do_login.jsp" accept-charset="utf-8" id="form" method="post">
+               <div class="table">
+                       <div class="table_header">
+                               Bitte geben Sie Ihre Kundennummer und Passwort ein:
+                       </div>
+
+                       <fieldset id="login_data">
+                               <legend title="Bitte Daten eingeben:">Bitte Daten eingeben:</legend>
+
+                               <div class="table_row">
+                                       <div class="data_left">
+                                               Kundennummer:
+                                       </div>
+                                       <div class="data_right">
+                                               <input type="text" name="id" size="10" maxlength="20" />
+                                       </div>
+                               </div>
+
+                               <div class="clear"></div>
+
+                               <div class="table_row">
+                                       <div class="data_left">
+                                               Passwort:
+                                       </div>
+                                       <div class="data_right">
+                                               <input type="password" name="password" size="10" maxlength="255" />
+                                       </div>
+                               </div>
+
+                               <div class="clear"></div>
+                       </fieldset>
+
+                       <div class="table_footer">
+                               <input type="hidden" name="redirect" value="<%=request.getRequestURI()%>" />
+                               <input type="reset" value="Formular zurücksetzen" />
+                               <input type="submit" name="send" value="Einloggen" />
+                       </div>
+               </div>
+       </form>
+</div>
diff --git a/web/static/gender_selection_box.jsp b/web/static/gender_selection_box.jsp
new file mode 100644 (file)
index 0000000..d761f48
--- /dev/null
@@ -0,0 +1,36 @@
+<%-- 
+       Document   : gender_selection_box
+       Created on : 11.08.2015, 13:02:12
+       Author     : Roland Haeder
+--%>
+<%@page import="org.mxchange.jcore.contact.Gender"%>
+<%@page import="org.mxchange.pizzaapplication.application.PizzaServiceApplication"%>
+<%@page import="org.mxchange.pizzaapplication.application.PizzaApplication"%>
+<%@page import="org.mxchange.pizzaapplication.beans.CustomerBean" %>
+
+<jsp:useBean id="customer" scope="session" class="org.mxchange.pizzaapplication.customer.bean.PizzaServiceCustomerBean" type="CustomerBean" />
+
+<%
+       // Init application instance
+       PizzaApplication app = PizzaServiceApplication.getInstance(application);
+%>
+
+<select name="gender" id="gender" size="1" <%=app.getDisabledHtmlFromSession(request, session)%>>
+       <%
+       // "Walk" through all genders and output them
+       for (final Gender gender : Gender.values()) {
+               %>
+               <option value="<%=gender.name()%>"<%
+               // Get gender from bean
+               Gender value=  customer.getGender();
+
+               // Test it
+               if (value.equals(gender)) {
+                       // Output selected="selected"
+                       out.print("selected=\"selected\"");
+               }
+               %>><%=gender%></option>
+               <%
+       }
+       %>
+</select>
index a8a22db9af2f460bf10c739e9b2c57b564dc7d69..1f72802be8de3c9a70e3584ad0ff6de553085184 100644 (file)
@@ -13,8 +13,8 @@
        </ul>
 
        <ul>
-               <li><a href="<%=request.getContextPath()%>/login.jsp" title="Login für bestehende Kunden">Einloggen</a></li>
-               <li><a href="<%=request.getContextPath()%>/register.jsp" title="Anmeldung als neuer Kunde">Neuer Kunde</a></li>
-               <li><a href="<%=request.getContextPath()%>/lost_passwd.jsp" title="Neues Passwort erstellen">Passwort vergessen?</a></li>
+               <li><a href="<%=request.getContextPath()%>/customer/login.jsp" title="Login für bestehende Kunden">Einloggen</a></li>
+               <li><a href="<%=request.getContextPath()%>/customer/register.jsp" title="Anmeldung als neuer Kunde">Neuer Kunde</a></li>
+               <li><a href="<%=request.getContextPath()%>/customer/lost_passwd.jsp" title="Neues Passwort erstellen">Passwort vergessen?</a></li>
        </ul>
 </div>
index c4a12262be837eac61b383801122dcb8c49c1106..c8580af0674272eadf13f296c63682b12e41aaf5 100644 (file)
@@ -22,11 +22,15 @@ div {
        clear: both;
 }
 
-table {
+table, .table {
        margin: 0px;
        padding: 0px;
 }
 
+.table {
+       width: 500px;
+}
+
 .table_row {
        width: 300px;
 }