Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes JSF and the fly likes Problem with my FacesContext Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Problem with my FacesContext" Watch "Problem with my FacesContext" New topic
Author

Problem with my FacesContext

Yudiel Guerra
Greenhorn

Joined: Mar 19, 2014
Posts: 2
Hi I have the following problem in my application, I am using a method called timer () and inside of the not recognize me the visual of the application ie the different components of the view that if they are in that moment .. Cheers and thanks beforehand

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15964
    
  19

We've got a FAQ topic called "ItdoesntworkisUseless". Because truthfully, I don't know what your problem is.

Well, actually, I may, but it isn't the problem that you are thinking of.

J2EE request/response handling objects are forbidden by the J2EE spec from spawning threads. Anything that you do on a timer needs to be in a resource that isn't running under request/response processing. Which means that in particular, spawning a thread and/or waiting on a resource is not allowed in JSF backing beans or in code that they invoke.

Beyond that, a common beginner fault is being too swift to consider grabbing UIComponent objects and mucking around with them, JSF is designed to work primarily with POJO objects, so when you start touching stuff that's outside of the javax.faces model classes, it's usually an indication that you're doing it wrong.

Speaking of common beginner stuff, the FacesContext is something that's built by the FacesServlet to serve a single HTTP request/response processing cycle and immediately destroyed as soon as the response has been sent back. People who attempt to obtain and work with the FacesContext in a non-JSF context, such as a generic servlet or JSP are often frustrated to discover that what they get back is null, not a FacesContext.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with my FacesContext
 
Similar Threads
How to inject FacesContext into Message-driven bean?
UIViewRoot findComponent
UiViewRoot - findComponent dont work
Using setTransient(true) to correct Duplicate Component Id
JSF Rendered attribute question