File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Problem with my FacesContext" Watch "Problem with my FacesContext" New topic

Problem with my FacesContext

Yudiel Guerra

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: 17421

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.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: Problem with my FacesContext
It's not a secret anymore!