From: Roland Haeder Date: Wed, 12 Aug 2015 12:35:40 +0000 (+0200) Subject: Continued with project: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=105c9d9553acf60bb2e531321dfd18d02904b3ce;p=pizzaservice-war.git Continued with project: - 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 --- diff --git a/src/java/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java b/src/java/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java index 06487532..f858eb5a 100644 --- a/src/java/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java +++ b/src/java/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java @@ -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); } diff --git a/src/java/org/mxchange/pizzaapplication/database/frontend/product/PizzaProductDatabaseFrontend.java b/src/java/org/mxchange/pizzaapplication/database/frontend/product/PizzaProductDatabaseFrontend.java index 4dacd358..6830a0f8 100644 --- a/src/java/org/mxchange/pizzaapplication/database/frontend/product/PizzaProductDatabaseFrontend.java +++ b/src/java/org/mxchange/pizzaapplication/database/frontend/product/PizzaProductDatabaseFrontend.java @@ -75,7 +75,7 @@ public class PizzaProductDatabaseFrontend extends BaseDatabaseFrontend implement */ @Override @SuppressWarnings ("unchecked") - public Iterator getProducts () { + public Iterator getProducts () throws IOException, BadTokenException { // Trace message this.getLogger().trace("CALLED!"); //NOI18N diff --git a/src/java/org/mxchange/pizzaapplication/database/frontend/product/ProductFrontend.java b/src/java/org/mxchange/pizzaapplication/database/frontend/product/ProductFrontend.java index b94d5502..c7f8b72a 100644 --- a/src/java/org/mxchange/pizzaapplication/database/frontend/product/ProductFrontend.java +++ b/src/java/org/mxchange/pizzaapplication/database/frontend/product/ProductFrontend.java @@ -16,8 +16,10 @@ */ 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 getProducts (); + public Iterator getProducts () throws IOException, BadTokenException; } diff --git a/web/bye.jsp b/web/bye.jsp index 678c9da9..92ecc364 100644 --- a/web/bye.jsp +++ b/web/bye.jsp @@ -4,7 +4,7 @@ Author : Roland Haeder --%> -<%@page errorPage="errorHandler.jsp" %> +<%--<%@page errorPage="errorHandler.jsp" %>--%> <%@page import="org.mxchange.pizzaapplication.application.PizzaServiceApplication"%> diff --git a/web/index.jsp b/web/index.jsp index ffc06eb0..d6129ad3 100644 --- a/web/index.jsp +++ b/web/index.jsp @@ -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"%>