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

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)
Conversion library for S-expressions to DOT
How to write a custom ConverterHelper class in Restlet 2.1
How would I convert a MIDI file into a string?
Xugller illegalArgumentExeception
Javacard 2.2.1 converter not working in windows

Categories

HOME
plsql
redis
xamarin.android
google-contacts
backup
google-sheets-api
cocos2d-x-3.0
zend-framework2
terrain
filter
xcode8.3
diagram
vuex
xamarin-studio
wysiwyg
image-recognition
postmessage
scala-native
tweets
esql
rails-activerecord
tarantool
source-maps
piwik
iis-10
croppic
frp
helper
reactiveui
ivy
gpib
polymorphism
ifstream
node-horseman
recurrence-relation
honeysql
stdclass
datalog
dojox.mobile
taglib
amd
email-parsing
azure-availability-set
nsjsonserialization
gauss
istorage
webdatagrid
goquery
quintus
visual-studio-templates
spark-cassandra-connector
contour
squirrel
picking
financial
flexjson
bluesnap
asymptote
sonarqube5.3
android-viewholder
schtasks.exe
anti-patterns
paypal-nvp
webhdfs
ubercart
sparse-file
pgm
code-first-migrations
python-ggplot
utf-32
rhel5
line-numbers
temp-tables
jquery-autocomplete
funq
map-force
hamsterdb
pyjade
opendata
gamepad
fogbugz-api
loop-invariant
symphony-cms
sametime
icsharpcode
code-conversion
wcf-web-api
driving-directions
fileutils
throttling
nemerle
charts4j
posting
exitstatus
querypath
plinq
web-statistics
cots

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