In JSF2 there are tons of new and interesting features. Some are big changes and some are really neat small additional things, like the ProjectStage Enum.
Especially for tool-vendors (and component libraries) this is useful to specify the “runtime”. (Development vs. Production vs. SystemTest vs. UnitTest). One example could be the Trinidad Skinning facility. Currently by default we do compression of the generated CSS selectors, but that is a PITA for debugging (even with firebug). However, there is a way around it. Specify the following in your web.xml:
<context-param> <param-name> org.apache.myfaces.trinidad.DISABLE_CONTENT_COMPRESSION </param-name> <param-value>true</param-value> </context-param>
Now… with the upcoming JSF2 ProjectStage Enum, we could easily change the Skinning facility to leverage the different possible values. Production, for instance, means compression is on, Development means there is no compression, etc.
However… this means the developer always has to change the WEB.XML (or do some JNDI setup); same is true for Trinidad’s skinning today 😉 The big problem with the ProjectStage is that the JSF spec only talks about web.xml and JNDI for doing the setup configuration. It would be very cool if the specification would be changed to actually allow system props, since that makes our life easier!
One could easily launch a Trinidad application and on the commandline you specify the actual “project stage”:
mvn jetty:run -Djavax.faces.PROJECT_STAGE=Development
That would be great!
I filed a bug against the spec for this topic.