]> git.mxchange.org Git - addressbook-war.git/commitdiff
forClass OR value :-)
authorRoland Haeder <roland@mxchange.org>
Mon, 12 Oct 2015 15:05:49 +0000 (17:05 +0200)
committerRoland Haeder <roland@mxchange.org>
Mon, 12 Oct 2015 15:05:49 +0000 (17:05 +0200)
src/java/org/mxchange/addressbook/beans/country/CountryWebBean.java
src/java/org/mxchange/jcountry/data/CountryConverter.java
src/java/org/mxchange/jphone/phonenumbers/smsprovider/SmsProviderConverter.java

index b8dc6c5102a5f8f7e68fd0de7c9e814659af6954..3f0de149312ca8ecc36249e63a1db0dcab9336b7 100644 (file)
@@ -62,7 +62,7 @@ public class CountryWebBean implements CountryWebController {
                        Context context = new InitialContext();
 
                        // Try to lookup the bean
-                       this.countryBean = (AddressbookCountrySingletonBeanRemote) context.lookup("java:global/addressbook-ejb/country!org.mxchange.jcountry.data.AddressbookCountrySingletonBeanLocal"); //NOI18N
+                       this.countryBean = (AddressbookCountrySingletonBeanRemote) context.lookup("java:global/addressbook-ejb/country!org.mxchange.jcountry.data.AddressbookCountrySingletonBeanRemote"); //NOI18N
                } catch (final NamingException ex) {
                        // Continue to throw
                        throw new FaceletException(ex);
index 139bff04de48c4f6cb205f7912735d9981a2ac1f..71b108b4c20515edda4eed728a89835734894c79 100644 (file)
@@ -31,14 +31,13 @@ import javax.naming.NamingException;
 import org.mxchange.addressbook.beans.country.CountryWebController;
 import org.mxchange.jcoreeelogger.beans.local.logger.Log;
 import org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal;
-import org.mxchange.jphone.phonenumbers.smsprovider.CellphoneProvider;
 
 /**
  * Converter for country instance
  * <p>
  * @author Roland Haeder
  */
-@FacesConverter (forClass = CellphoneProvider.class, value = "country")
+@FacesConverter (value = "country")
 public class CountryConverter implements Converter {
 
        /**
index 10fc783a507360e1d581bf1b3879c2f1d94ebf0a..2cfeb90ddede7c49b72534e49c5e1af90636836b 100644 (file)
@@ -37,15 +37,9 @@ import org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal;
  * <p>
  * @author Roland Haeder
  */
-@FacesConverter (forClass = CellphoneProvider.class, value = "cellphoneCarrier")
+@FacesConverter (value = "cellphoneCarrier")
 public class SmsProviderConverter implements Converter {
 
-       /**
-        * Category bean
-        */
-       @Inject
-       private SmsProviderWebController providerController;
-
        /**
         * Logger instance
         */
@@ -53,22 +47,10 @@ public class SmsProviderConverter 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 SmsProviderWebController providerController;
 
        @Override
        public Object getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
@@ -134,4 +116,22 @@ public class SmsProviderConverter implements Converter {
                return String.valueOf(((SmsProvider) value).getProviderId());
        }
 
+       /**
+        * 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
+               }
+       }
+
 }