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

what coordinate system is this and how to convert it to longitude latitudes?
Converter doesn't work and not taken by criteria
Working with CGM version 4 files?
Convert docx to mediawiki and preserve [[Image:]]
Can gnuplot convert my temperature data on the fly?
Convert from VMWare to Hyper-V
Convert AMR file to WAV on C#
Submitting an SGE job to PBS/Torque
How to convert .rtp file(recorded using RTP Proxy codec G711) to .wav file
Converting pt and px
javascript change chars in a string
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

Categories

HOME
jsf
project-management
textwatcher
csvhelper
couchdb-2.0
appmaker
file-io
browserify
nodemailer
powershell-v3.0
keystore
x11
xamarin-studio
rfid
titan
scaling
saiku
google-openid
nmf
visual-c++-2017
upnp
chrome-native-messaging
invoke-command
sharp
ipfw
stocks
getline
data-extraction
large-data
openpgp
powershell-remoting
precedence
oscommerce
inkscape
es-shell
codesys
finite-element-analysis
floor
applepayjs
multi-agent
rollback
mbaas
tcserver
selenium-firefoxdriver
jcreator
shinyjs
sqldatareader
master
ebtables
iostat
rstudio-server
excon
bacnet
freetype2
gradle-eclipse
mongo-c-driver
handlebars.java
git-rebase
document-oriented-db
affix
sourcegear-vault
pyrocms
team-build
ibm-data-studio
lines-of-code
pgm
google-plus-one
obfuscar
grunt-express
collabnet
sid
bullet
funkload
anjuta
db4o
document-database
ng-hide
gridworld
carddav
localtime
fortran77
mozart-mvc
qsqltablemodel
blockingqueue
caliper
visual-web-gui
v4l
selectonemenu
mysql-error-1045
tcxgrid
gethashcode
hadoop-plugins
swfloader
microsoft.ink
visual-studio-2010-beta-2

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