Skip to main content

Blog Archive for cayhorstmann during January 2010

Composite components are a great feature of JSF 2.0. The canonical example is a login component with fields for the username and password: <mylib:login name="#{user.name}"      password="#{user.password}"      loginAction="#{user.login}"/> This has been well explained elsewhere....
One nice thing about JSF 2.0 is that they have taken good ideas from elsewhere, such as the “project stage” concept from Rails. If you set the project stage to ”development”, you get detailed error and warning messages. If you set it to “production”, you get more aggressive caching. Better diagnostics or better performance? The choice is yours, and that is good...
JSF 2 introduces an EL variable flash. Anything you set persists for one post-redirect-get cycle. (In contrast, anything in the request scope is gone after a redirect.) A typical use of the flash is for messages. A managed bean method might put a message in the flash, ExternalContext.getFlash().put("warning", "Your password is about to expire"); Then the...
A few weeks ago, Ed Burns posted a link to a blog on the JSF expert group mailing list, commenting “A nice one, but it doesn't mention JSF 2”. Ever the curmudgeon, I pointed out that it wasn't so nice that the blog's sample code used the JSF API in beans when it wasn't necessary—as does in fact a lot of sample code, even in the official Sun tutorials. Ed's response: “Cay,...