From 671a44105baedbf8e2381072f69c79fa61a82bc6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 19 Apr 2020 02:10:29 +0200 Subject: [PATCH] Product-only: - replaced FaceletException with FacesException MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../FinancialAdminGenericProductActionWebViewBean.java | 7 ++++--- .../FinancialAdminCategoryWebRequestBean.java | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/java/org/mxchange/jfinancials/beans/generic_product/action/FinancialAdminGenericProductActionWebViewBean.java b/src/java/org/mxchange/jfinancials/beans/generic_product/action/FinancialAdminGenericProductActionWebViewBean.java index cad332b4..ba2b0a0e 100644 --- a/src/java/org/mxchange/jfinancials/beans/generic_product/action/FinancialAdminGenericProductActionWebViewBean.java +++ b/src/java/org/mxchange/jfinancials/beans/generic_product/action/FinancialAdminGenericProductActionWebViewBean.java @@ -21,6 +21,7 @@ import java.text.MessageFormat; import javax.ejb.EJB; import javax.enterprise.event.Event; import javax.enterprise.inject.Any; +import javax.faces.FacesException; import javax.faces.view.ViewScoped; import javax.faces.view.facelets.FaceletException; import javax.inject.Inject; @@ -177,7 +178,7 @@ public class FinancialAdminGenericProductActionWebViewBean extends BaseFinancial // Is product i18n key already used? if (this.productListController.isProductI18nKeyAdded(this.getProductI18nKey())) { // Then throw exception - throw new FaceletException("Product i18n key " + this.getProductI18nKey() + " already added."); + throw new FacesException(MessageFormat.format("Product i18n key {0} already added.", this.getProductI18nKey())); } // Create current product instance @@ -191,7 +192,7 @@ public class FinancialAdminGenericProductActionWebViewBean extends BaseFinancial updatedProduct = this.adminProductBean.addGenericProduct(product); } catch (final ProductAlreadyAddedException ex) { // Continue to throw - throw new FaceletException(ex); + throw new FacesException(ex); } // Fire event @@ -549,7 +550,7 @@ public class FinancialAdminGenericProductActionWebViewBean extends BaseFinancial updatedProduct = this.adminProductBean.updateProductData(newProduct); } catch (final ProductNotFoundException ex) { // Throw again - throw new FaceletException(ex); + throw new FacesException(ex); } // Fire event diff --git a/src/java/org/mxchange/jfinancials/beans/product_category/FinancialAdminCategoryWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/product_category/FinancialAdminCategoryWebRequestBean.java index b5166e37..ec0721c4 100644 --- a/src/java/org/mxchange/jfinancials/beans/product_category/FinancialAdminCategoryWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/product_category/FinancialAdminCategoryWebRequestBean.java @@ -20,6 +20,7 @@ import javax.ejb.EJB; import javax.enterprise.context.RequestScoped; import javax.enterprise.event.Event; import javax.enterprise.inject.Any; +import javax.faces.FacesException; import javax.faces.view.facelets.FaceletException; import javax.inject.Inject; import javax.inject.Named; @@ -97,7 +98,7 @@ public class FinancialAdminCategoryWebRequestBean extends BaseFinancialsBean imp // Is i18n key already used? if (this.categoryListController.isCategoryI18nKeyAdded(this.getCategoryI18nKey())) { // Throw exception - throw new FaceletException("Category i18n key " + this.getCategoryI18nKey() + " is already used."); + throw new FacesException("Category i18n key " + this.getCategoryI18nKey() + " is already used."); } // Create category @@ -111,7 +112,7 @@ public class FinancialAdminCategoryWebRequestBean extends BaseFinancialsBean imp updatedCategory = this.categoryBean.addProductCategory(category); } catch (final CategoryAlreadyAddedException ex) { // Continue to throw - throw new FaceletException(ex); + throw new FacesException(ex); } // Fire event -- 2.39.5