]> git.mxchange.org Git - jfinancials-war.git/commitdiff
Product-only:
authorRoland Häder <roland@mxchange.org>
Sun, 19 Apr 2020 00:10:29 +0000 (02:10 +0200)
committerRoland Häder <roland@mxchange.org>
Sun, 19 Apr 2020 00:10:54 +0000 (02:10 +0200)
- replaced FaceletException with FacesException

Signed-off-by: Roland Häder <roland@mxchange.org>
src/java/org/mxchange/jfinancials/beans/generic_product/action/FinancialAdminGenericProductActionWebViewBean.java
src/java/org/mxchange/jfinancials/beans/product_category/FinancialAdminCategoryWebRequestBean.java

index cad332b43e2dad026709f1a277bbe1782210f460..ba2b0a0e3fecc7131d2c1a23cff2218627066985 100644 (file)
@@ -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
index b5166e37cd2627b8b2e27c2e2042d036e5dd859d..ec0721c49739df6312d12499b1e7503e15f25392 100644 (file)
@@ -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