Remko (My website)
SCJP 1.5, SCWCD 1.4, SCDJWS 1.4, SCBCD 1.5, ITIL(Manager), Prince2(Practitioner), Reading/ gaining experience for SCEA,
Remko Strating wrote:I had a problem where sometimes the FacesContext.getCurrentInstance() returns null.
In a thread I've read that adding the listener com.sun.faces.config.configureListener could solve this issue.
I tried to found the exact function of this listener but could not find a good answer.
Maybe someone could give me some information or a hint where to find.
Thanks in advance.
<A href="http://javaswamy.blogspot.com">My Blog</A>
Bauke Scholtz wrote:I don't recommend this approach.
If he is indeed trying to get the FacesContext inside a Filter, then there's a flaw in his design and he need to elaborate why he needs the FacesContext. If it is just for accessing managed beans or some other scoped attributes or some other stuff made available by request, session and application, he could perfectly use the (Http)ServletRequest for this which is already available inside a Filter.
By the way, why are you spamming an irrelevant link to your blog in every post? If you like to share it with others and want to increase your traffic, just place it in your signature.
<A href="http://javaswamy.blogspot.com">My Blog</A>
Remko (My website)
SCJP 1.5, SCWCD 1.4, SCDJWS 1.4, SCBCD 1.5, ITIL(Manager), Prince2(Practitioner), Reading/ gaining experience for SCEA,
Request scoped beans are just accessible by HttpServletRequest#getAttribute(), session scoped beans by HttpSession#getAttribute() and application scoped beans by ServletContext#getAttribute(). In the other way you can just set them by setAttribute().Remko Strating wrote:I use the facescontext for finding a relation between two managed beans.
Remko (My website)
SCJP 1.5, SCWCD 1.4, SCDJWS 1.4, SCBCD 1.5, ITIL(Manager), Prince2(Practitioner), Reading/ gaining experience for SCEA,
Remko (My website)
SCJP 1.5, SCWCD 1.4, SCDJWS 1.4, SCBCD 1.5, ITIL(Manager), Prince2(Practitioner), Reading/ gaining experience for SCEA,
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |