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 to convert ArcMap file to log file
how to embed currency converter on my website
Converting a text file to ascii in PYTHON code then ascii character
Conversion of standard InChI to InChI with fixed-hydrogen-layer
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?

Categories

HOME
symfony
elixir
vhdl
warnings
reportportal
memory-leaks
mapbox-gl-js
playframework
command
codeeffects
rocketmq
recyclerview
flyway
hyperledger-fabric
gspread
vuex
eclipse-cdt
camera-calibration
mongodb-query
dlib
cross-platform
yeoman-generator
off-canvas-menu
jcl
chocolatey
propel2
device-detection
uiautomator
scalaz7
servicemix
remove-method
memsql
csh
sumo
pipelinedb
ui5
aurelia-binding
datadog
red-black-tree
outsystems
service-locator
wfp
autocompletetextview
concrete5-5.7
fax
control-flow-graph
amazon-clouddrive
rdw
livescribe
struts-layout
forerunnerdb
etherpad
hpcc
pspice
nsfetchedresultscontrolle
android-navigationview
pdflib
gradle-script-kotlin
aescryptoserviceprovider
wcf-ria-services
pagekit
jackson-databind
spring-lemon
spring-repositories
codesign
selecteditem
search-regex
fortran90
oai
apigee-baas
risk-analysis
xjc
pyopengl
swift2.1
snmp4j
mfmailcomposeviewcontroll
funkload
wss
alertifyjs
sgml
lumx
resource-files
json-patch
cilk-plus
goinstant
apache2.2
mstsc
symphony-cms
fileconveyor
fortran77
ubuntu-11.10
maven-ear-plugin
xgettext
n-layer
mpmovieplayer
die
nemerle
gethashcode
audiostreamer
jquery-ui-button
chdatastructures
graph-layout
configurable
ajaxpro
visual-studio-dbpro
document-library
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