* <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
*/
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) {
// 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
+ }
+ }
}
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);