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 do i convert photographs to tensors
convert music to image and back
Method with #JmsListener not executed when setting custom message converter
Convert text dataset to .arff file
How convert all files (uncompressed mkv DVD movies) to compressed mp4
How to convert BitmapImage to WriteableBitmap in Universal application for windows 10?
Celsius, Fahrenheit converter in java with JOptionPane
comparing a string in MIPS
Convert exe video to avi
filehelpers Custom converter
Converting numbers to hexadecimal
MIPS Roman numeral converter
Spring OAuth2 missing converter for DefaultOAuth2Token
Downgrade Conversion from Swagger 2.0 to 1.2
How to convert ArcMap file to log file
how to embed currency converter on my website

Categories

HOME
converter
scipy
sbt-assembly
java-home
currency
packer
onsen-ui2
activesync
nuxt.js
future
jacoco
device-detection
plupload
sonarqube-msbuild-runner
tcpclient
memsql
java-ee-7
vcard
mayavi
datadog
blackboard
smart-mobile-studio
pljson
modelandview
npm-shrinkwrap
pox
color-scheme
bigcartel
zero
topic-modeling
linq-to-entities
socketscan
nashorn
control-flow-graph
dojox.mobile
fastq
gist
tiddlywiki
component-pascal
butterknife
fontconfig
unity3d-editor
bettercms
efxclipse
gulp-typescript
multiple-file-upload
unsatisfiedlinkerror
mongoskin
fps
search-regex
concur
acm
zuora
python-winshell
anti-patterns
wif
ffprobe
gray-code
isml
apache-mina
low-level
android-search
odftoolkit
mser
ogr2ogr
method-overriding
aquafold
picat
kraken.js
unison
anjuta
bsod
pyjade
.net-cf-3.5
sql-server-2012-web
nscolor
sttwitter
shiva3d
prng
dynamic-data
mozart-mvc
gjs
hashalgorithm
executable-format
hardware-acceleration
grooveshark
soft-keyboard
virtualquery

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile