]> git.mxchange.org Git - pizzaservice-war.git/commitdiff
Continued a bit:
authorRoland Haeder <roland@mxchange.org>
Fri, 28 Aug 2015 09:34:10 +0000 (11:34 +0200)
committerRoland Haeder <roland@mxchange.org>
Fri, 28 Aug 2015 09:34:10 +0000 (11:34 +0200)
- used controller bean
- messages formatted and ignored for internationalization
Signed-off-by:Roland Häder <roland@mxchange.org>

src/java/org/mxchange/pizzaapplication/beans/PizzaServiceBean.java
web/index.jsp

index d234d668cb88deca35af4ad54ad63e639e8449ea..b077f1cfb3f76c7db6a174620b618a8b182ffcaa 100644 (file)
@@ -18,6 +18,7 @@ package org.mxchange.pizzaapplication.beans;
 
 import java.io.IOException;
 import java.sql.SQLException;
+import java.text.MessageFormat;
 import java.util.Iterator;
 import javax.annotation.PostConstruct;
 import javax.enterprise.context.SessionScoped;
@@ -47,7 +48,7 @@ import org.mxchange.pizzaapplication.product.Product;
  *
  * @author Roland Haeder
  */
-@Named("service")
+@Named("controller")
 @SessionScoped
 public class PizzaServiceBean implements PizzaBean {
        /**
@@ -83,7 +84,7 @@ public class PizzaServiceBean implements PizzaBean {
        {
                // Get new application instance
                this.LOG = LogManager.getLogger(this);
-               this.LOG.debug("INITIALIZER!");
+               this.LOG.debug("INITIALIZER!"); //NOI18N
                this.app = new PizzaServiceApplication();
        }
 
@@ -91,19 +92,19 @@ public class PizzaServiceBean implements PizzaBean {
         * Default constructor
         */
        public PizzaServiceBean () {
-               this.getLogger().trace("CALLED!");
+               this.getLogger().trace("CALLED!"); //NOI18N
        }
 
        @Override
        @PostConstruct
        public void init () throws FacesException {
                // Trace message
-               this.getLogger().trace("application=" + this.getApplication() + ",basket=" + this.getBasket() + " - CALLED!");
+               this.getLogger().trace(MessageFormat.format("application={0},basket={1} - CALLED!", this.getApplication(), this.getBasket())); //NOI18N
 
                // Must not be null
                if (this.getApplication() == null) {
                        // Abort here
-                       throw new NullPointerException("application is null");
+                       throw new NullPointerException("application is null"); //NOI18N
                }
 
                try {
@@ -419,7 +420,7 @@ public class PizzaServiceBean implements PizzaBean {
        @Override
        public BasketBean getBasket () {
                // Trace message
-               this.getLogger().trace("basket=" + this.basket + " - EXIT!");
+               //* NOISY-DEBUG: */ this.getLogger().trace(MessageFormat.format("basket={0} - EXIT!", this.basket)); //NOI18N
 
                // Return it
                return this.basket;
@@ -431,7 +432,7 @@ public class PizzaServiceBean implements PizzaBean {
        @Override
        public void setBasket (final BasketBean basket) {
                // Trace message
-               this.getLogger().trace("basket=" + basket + " - CALLED!");
+               //* NOISY-DEBUG: */ this.getLogger().trace(MessageFormat.format("basket={0} - CALLED!", basket)); //NOI18N
 
                // Set it here
                this.basket = basket;
@@ -443,7 +444,7 @@ public class PizzaServiceBean implements PizzaBean {
        @Override
        public ServletContext getApplication () {
                // Trace message
-               this.getLogger().trace("application=" + this.application + " - EXIT!");
+               //* NOISY-DEBUG: */ this.getLogger().trace(MessageFormat.format("application={0} - EXIT!", this.application)); //NOI18N
 
                // Return it
                return this.application;
@@ -455,7 +456,7 @@ public class PizzaServiceBean implements PizzaBean {
        @Override
        public void setApplication (final ServletContext application) {
                // Trace message
-               this.getLogger().trace("application=" + application + " - CALLED!");
+               //* NOISY-DEBUG: */ this.getLogger().trace(MessageFormat.format("application={0} - CALLED!", application)); //NOI18N
 
                // Set it here
                this.application = application;
index 0a33ffc53d7db91beaa9b391f4537badc5ca2138..719e5ccbcee6b0b1179b4eaca984f3761dfb7697 100644 (file)
                                        Product product = iterator.next();
 
                                        // Debug message
-                                       product.getLogger().debug("product.itemId=" + product.getItemId());
+                                       controller.getLogger().debug("product=" + product);
 
                                        // Create an item instance form this product
                                        AddableBasketItem item = controller.getBasket().getItem(product);
 
                                        // Debug message
-                                       product.getLogger().debug("item=" + item);
+                                       controller.getLogger().debug("item=" + item);
 
                                        // Has it been already added to the basket?
                                        if (item != null) {