| Author |
Access ManagedBean from Validator
|
Dominik Müller
Ranch Hand
Joined: Apr 28, 2009
Posts: 36
|
|
Hi Together,
in some Tutorials is explained how to access a attributes of managedbean in source code:
My Problem is, that eclipse throw an Error when trying to insert it into an Validator-Class
Some Ideas?
thanks a lot
Dom
|
 |
Tim Holloway
Saloon Keeper
Joined: Jun 25, 2001
Posts: 14487
|
|
Yes. That's doing it the hard way. You'd do that if you needed access to stuff at the EL level.
The easier way is to take advantage of the fact that managed beans are scoped POJOs and access them as session or request attributes. You still need the FacesContext, but instead of looking for the EL Resolved, dig into the FaceContext's J2EE objects.
I normally provide a set of utility classes for that kind of work so I can keep the actual FacesContext references out of my backing beans, It insulates me from possible future changes and makes the backing beans more portable.
|
Customer surveys are for companies who didn't pay proper attention to begin with.
|
 |
 |
|
|
subject: Access ManagedBean from Validator
|
|
|