From 105c9d9553acf60bb2e531321dfd18d02904b3ce Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Wed, 12 Aug 2015 14:35:40 +0200 Subject: [PATCH] =?utf8?q?Continued=20with=20project:=20-=20Method=20getPr?= =?utf8?q?oducts()=20throws=20now=20more=20exceptions=20(from=20low-level?= =?utf8?q?=20classes)=20-=20These=20need=20to=20be=20thrown=20until=20they?= =?utf8?q?=20reach=20the=20application=20server's=20exception=20handler=20?= =?utf8?q?-=20Temporary=20commented=20out=20error=20pages=20Signed-off-by:?= =?utf8?q?Roland=20H=C3=A4der=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../application/PizzaServiceApplication.java | 9 +++++---- .../frontend/product/PizzaProductDatabaseFrontend.java | 2 +- .../database/frontend/product/ProductFrontend.java | 6 +++++- web/bye.jsp | 2 +- web/index.jsp | 2 +- 5 files changed, 13 insertions(+), 8 deletions(-) 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"%> -- 2.39.5