]> git.mxchange.org Git - pizzaservice-war.git/commitdiff
forClass OR value :-)
authorRoland Haeder <roland@mxchange.org>
Mon, 12 Oct 2015 15:05:42 +0000 (17:05 +0200)
committerRoland Haeder <roland@mxchange.org>
Mon, 12 Oct 2015 15:05:42 +0000 (17:05 +0200)
src/java/org/mxchange/jshopcore/model/category/CategoryConverter.java
src/java/org/mxchange/pizzaapplication/beans/country/CountryWebBean.java

index 9ad96b2875c9d6bafb473d7462eca2cbf731fe0a..b811c9b5011947b690c2c0cb24895c1874bffa93 100644 (file)
@@ -37,15 +37,9 @@ import org.mxchange.pizzaapplication.beans.shop.ShopWebController;
  * <p>
  * @author Roland Haeder
  */
-@FacesConverter (forClass = ProductCategory.class, value = "category")
+@FacesConverter (value = "category")
 public class CategoryConverter implements Converter {
 
-       /**
-        * Category bean
-        */
-       @Inject
-       private ShopWebController shopController;
-
        /**
         * Logger instance
         */
@@ -53,22 +47,10 @@ public class CategoryConverter implements Converter {
        private LoggerBeanLocal loggerBeanLocal;
 
        /**
-        * Initialization of this converter
+        * Category bean
         */
-       @PostConstruct
-       public void init () {
-               // Try to get it
-               try {
-                       // Get initial context
-                       Context context = new InitialContext();
-
-                       // Lookup logger
-                       this.loggerBeanLocal = (LoggerBeanLocal) context.lookup("java:global/jcore-logger-ejb/logger!org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal"); //NOI18N
-               } catch (final NamingException ex) {
-                       // Continue to throw it
-                       throw new RuntimeException("context.lookup() failed.", ex); //NOI18N
-               }
-       }
+       @Inject
+       private ShopWebController shopController;
 
        @Override
        public Object getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
@@ -133,4 +115,22 @@ public class CategoryConverter implements Converter {
                // Return category id
                return String.valueOf(((Category) value).getCategoryId());
        }
+
+       /**
+        * Initialization of this converter
+        */
+       @PostConstruct
+       public void init () {
+               // Try to get it
+               try {
+                       // Get initial context
+                       Context context = new InitialContext();
+
+                       // Lookup logger
+                       this.loggerBeanLocal = (LoggerBeanLocal) context.lookup("java:global/jcore-logger-ejb/logger!org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal"); //NOI18N
+               } catch (final NamingException ex) {
+                       // Continue to throw it
+                       throw new RuntimeException("context.lookup() failed.", ex); //NOI18N
+               }
+       }
 }
index 940a42efe315b3e4f4b4870126310ac2d095189d..bba9b955a8c4b2ee3a470a4a9dc8085441d8a10a 100644 (file)
@@ -62,7 +62,7 @@ public class CountryWebBean implements CountryWebController {
                        Context context = new InitialContext();
 
                        // Try to lookup the bean
-                       this.countryBean = (CountrySingletonBeanRemote) context.lookup("ejb/addressbook-singleton-country"); //NOI18N
+                       this.countryBean = (CountrySingletonBeanRemote) context.lookup("java:global/addressbook-ejb/country!org.mxchange.jcountry.data.AddressbookCountrySingletonBeanLocal"); //NOI18N
                } catch (final NamingException ex) {
                        // Continue to throw
                        throw new FaceletException(ex);