converter


ApplicationScoped bean not injected in JSF 2.3 FacesConverter


I have following FacesConverter:
#FacesConverter(forClass = Onderwerp.class, managed = true)
public class OnderwerpConverter implements Converter<Onderwerp> {
#Inject
private Web web;
#Override
public Onderwerp getAsObject(FacesContext context, UIComponent component, String value) {
log.trace("Converting to object from string: " + value);
return web.getAllActiveOnderwerpen().stream().filter(o -> o.getId().equals(Long.parseLong(value))).findFirst().get();
}
#Override
public String getAsString(FacesContext context, UIComponent component, Onderwerp onderwerp) {
log.trace("Converting to string from object: " + onderwerp);
return onderwerp.getId().toString();
}
}
The referenced CDI bean is:
#Named
#ApplicationScoped
public class Web { ... }
Faces-config.xml is:
<?xml version="1.0" encoding="UTF-8"?>
<faces-config xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_3.xsd" version="2.3">
Now whatever kind of bean I inject via #Inject it is always null. It seems the injection feature in 2.3 is not working (yet), or I am missing something :)
I'm using Mojarra 2.3.0.
My current workaround is replacing the code where I need the injected CDI bean like this:
return CDI.current().select(Web.class).get().getAllActiveOnderwerpen().stream().filter(o -> o.getId().equals(Long.parseLong(value))).findFirst().get();
This works fine, but is kinda ugly of course :)
Anyone has experienced this behavior?

Related Links

How can I use a CustomConverter with Dozer to convert multiple entities into one entity with a list field?
Convert T-SQL Declare statement to SAP HANA
Convert TEXT To PDF Using PDFSharp
XSLT or BizTalk-Mapping generated from Excel
Convert a pdf to tiff with abcpdf gives a black polygon in the result
Converting Non-ASCII code to ASCII equivalent in terms of look
How to add a converter to parameterized messages in JSF 1.2?
Convert text top hex equivalent
USA and Canada with jvectormap
Which converters Seam used by default for parameters passed to page.xml
Convert from windows .dmp to linux core file
Excel 2013 - PowerPivot Add-Ins : error with “MetConv.txt” file
Asn.1 development tools, CDR convert to XML using Java
Puppet to chef converter
How convert a lif file to ascii file
How can I convert an SVG file to a format read by Cinema 4D as Vector (like Adobe Illustrator ai file)

Categories

HOME
rest
plsql
vb6
raspbian
bower
paramiko
google-contacts
translation
fparsec
otrs
wms
laravel-5.2
parse-server
javamail
histogrammar
vsftpd
xamarin-studio
wysiwyg
nuxt.js
cosmicmind
opera-mini
bar-chart
arm-template
movies
ip-camera
pycrypto
tortoisegit
jquery-form-validator
facebook4j
myob
bootstrap-typeahead
pentaho-report-designer
aurelia-binding
encase
entity-system
smart-mobile-studio
oracle-xml-db
fabric-digits
recurrence-relation
css-counter
oscommerce
rhel.net
cgo
ssh.net
jupyter-console
stereo-3d
html-agility-pack
pdftk
double-buffering
drawingarea
uiviewpropertyanimator
applepayjs
azureportal
rhel6
photon-controller
fontconfig
quintus
in-memory-database
selenium-firefoxdriver
opencpu
emgu
atlassian-crowd
cfeclipse
backstop.js
chessboard.js
dts
django-filer
asteriskami
inotifypropertychanged
spatial-query
gemini
remoteapp
concur
insertion-sort
urn
debian-based
shift-jis
git-checkout
c++-actor-framework
qtestlib
adcolony
hidden-field
dmp
wss
gamepad
fogbugz-api
jqmobi
haskell-platform
google-closure-library
digital-design
soa-suite
graph-coloring
zend-framework-modules
dropdownlistfor
linkedhashset
redirectstandardoutput
macruby
gjs
jquery-selectbox
nemerle
associative
communicationexception
gwt-2.2-celltable
webrat
openwysiwyg

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App