From: Roland Haeder Date: Mon, 12 Oct 2015 15:05:42 +0000 (+0200) Subject: forClass OR value :-) X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=27a8e0100b1df116783c612a36961fb0d04cafcc;p=pizzaservice-war.git forClass OR value :-) --- diff --git a/src/java/org/mxchange/jshopcore/model/category/CategoryConverter.java b/src/java/org/mxchange/jshopcore/model/category/CategoryConverter.java index 9ad96b28..b811c9b5 100644 --- a/src/java/org/mxchange/jshopcore/model/category/CategoryConverter.java +++ b/src/java/org/mxchange/jshopcore/model/category/CategoryConverter.java @@ -37,15 +37,9 @@ import org.mxchange.pizzaapplication.beans.shop.ShopWebController; *

* @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 + } + } } diff --git a/src/java/org/mxchange/pizzaapplication/beans/country/CountryWebBean.java b/src/java/org/mxchange/pizzaapplication/beans/country/CountryWebBean.java index 940a42ef..bba9b955 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/country/CountryWebBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/country/CountryWebBean.java @@ -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);