]> git.mxchange.org Git - pizzaservice-war.git/commitdiff
Continued with project:
authorRoland Haeder <roland@mxchange.org>
Wed, 12 Aug 2015 12:35:40 +0000 (14:35 +0200)
committerRoland Haeder <roland@mxchange.org>
Wed, 12 Aug 2015 12:35:40 +0000 (14:35 +0200)
- Method getProducts() throws now more exceptions (from low-level classes)
- These need to be thrown until they reach the application server's exception handler
- Temporary commented out error pages
Signed-off-by:Roland Häder <roland@mxchange.org>

src/java/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java
src/java/org/mxchange/pizzaapplication/database/frontend/product/PizzaProductDatabaseFrontend.java
src/java/org/mxchange/pizzaapplication/database/frontend/product/ProductFrontend.java
web/bye.jsp
web/index.jsp

index 06487532140d90e50ce9c661a9fe46311dad7c49..f858eb5a58e135b80f815cb23ca02b34e2dfb966 100644 (file)
@@ -30,6 +30,7 @@ import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpSession;
 import org.mxchange.jcore.contact.Gender;
+import org.mxchange.jcore.exceptions.BadTokenException;
 import org.mxchange.jcore.exceptions.UnsupportedDatabaseBackendException;
 import org.mxchange.pizzaapplication.BasePizzaServiceSystem;
 import org.mxchange.pizzaapplication.customer.Customer;
@@ -80,7 +81,7 @@ public class PizzaServiceApplication extends BasePizzaServiceSystem implements P
                        try {
                                // "service" is null, so initialize it
                                instance = new PizzaServiceApplication(context);
-                       } catch (final UnsupportedDatabaseBackendException | SQLException ex) {
+                       } catch (final UnsupportedDatabaseBackendException | SQLException | IOException | BadTokenException ex) {
                                throw new ServletException(ex);
                        }
 
@@ -122,7 +123,7 @@ public class PizzaServiceApplication extends BasePizzaServiceSystem implements P
         * Constructor with servet configuration
         * @param context Servlet context
         */
-       private PizzaServiceApplication (final ServletContext context) throws UnsupportedDatabaseBackendException, SQLException {
+       private PizzaServiceApplication (final ServletContext context) throws UnsupportedDatabaseBackendException, SQLException, IOException, BadTokenException {
                // Call other constructor first
                this();
 
@@ -894,7 +895,7 @@ public class PizzaServiceApplication extends BasePizzaServiceSystem implements P
         * Fills products list
         * @todo Very hard-coded stuff ...
         */
-       private void fillProductsList () throws UnsupportedDatabaseBackendException, SQLException {
+       private void fillProductsList () throws UnsupportedDatabaseBackendException, SQLException, IOException, BadTokenException {
                // Trace message
                this.getLogger().trace("CALLED!"); //NOI18N
 
@@ -1098,7 +1099,7 @@ public class PizzaServiceApplication extends BasePizzaServiceSystem implements P
 
                        // Fill products list
                        this.fillProductsList();
-               } catch (final IOException | UnsupportedDatabaseBackendException | SQLException ex) {
+               } catch (final IOException | UnsupportedDatabaseBackendException | SQLException | BadTokenException ex) {
                        // Abort here
                        this.abortProgramWithException(ex);
                }
index 4dacd3585a7cd2c948a0e5802bba1762bdeb87dd..6830a0f88c08edfee9a7c5fc7a162f9555d98c29 100644 (file)
@@ -75,7 +75,7 @@ public class PizzaProductDatabaseFrontend extends BaseDatabaseFrontend implement
         */
        @Override
        @SuppressWarnings ("unchecked")
-       public Iterator<Product> getProducts () {
+       public Iterator<Product> getProducts () throws IOException, BadTokenException {
                // Trace message
                this.getLogger().trace("CALLED!"); //NOI18N
 
index b94d55022530b0cc9cbccaff926c327753e9e6c0..c7f8b72a89664c9eafd7032fa26cace3ad19f608 100644 (file)
  */
 package org.mxchange.pizzaapplication.database.frontend.product;
 
+import java.io.IOException;
 import java.util.Iterator;
 import org.mxchange.jcore.database.frontend.DatabaseFrontend;
+import org.mxchange.jcore.exceptions.BadTokenException;
 import org.mxchange.pizzaapplication.product.Product;
 
 /**
@@ -31,6 +33,8 @@ public interface ProductFrontend extends DatabaseFrontend {
         * An iterator on all products
         *
         * @return Iterator on all products
+        * @throws java.io.IOException If any IO error occurs
+        * @throws org.mxchange.jcore.exceptions.BadTokenException If a bad token was found in a file-based database backend's file ... ;-)
         */
-       public Iterator<Product> getProducts ();
+       public Iterator<Product> getProducts () throws IOException, BadTokenException;
 }
index 678c9da9b4103894e5e435f1b3a9536304616fc0..92ecc3644d6ece3c978125e960bde98fef835575 100644 (file)
@@ -4,7 +4,7 @@
        Author     : Roland Haeder
 --%>
 
-<%@page errorPage="errorHandler.jsp" %>
+<%--<%@page errorPage="errorHandler.jsp" %>--%>
 <%@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">
index ffc06eb0183e5ce7c19386758fa1bd4b6fad1f87..d6129ad3f77bfeb34d330847b87f8a7903c89433 100644 (file)
@@ -4,7 +4,7 @@
        Author     : Roland Haeder
 --%>
 
-<%@page errorPage="errorHandler.jsp" %>
+<%--<%@page errorPage="errorHandler.jsp" %>--%>
 <%@page import="java.util.Map"%>
 <%@page import="java.util.Iterator"%>
 <%@page import="org.mxchange.pizzaapplication.application.PizzaServiceApplication"%>