What is Apache MyFaces Ext-Scripting?
For all people who don't know what Ext-Script is (probably most of you). Apache MyFaces Extension Scripting short Ext-Script is an Apache MyFaces extension which provides scripting language support and dynamic recompilation for Apache MyFaces. This means you can code the JSF parts of your project in Groovy, Scala, Java and soon in JRuby and you get jsp like dynamic recompilation of those parts for free.
It does not work with all app servers due to server limitations (mostly in the classloader section) but so far it has been tested with
- Websphere Liberty Profile
- Glassfish and
More information about Apache MyFaces Ext-Scripting here.
This blogpost is about TomEE and how to get it up and running with this excellent lightweight server.
What is TomEE:
TomEE is a project, which provides a full JEE Web Profile to a Tomcat, it does not touch Tomcat but provides the entire JEE web profile stack (and more) within a standard Tomcat war container. Thats right no EAR anymore just drop a war and you will get JSF CDI etc... out of the box from the container.
More information on Apache TomEE here. No more bundling of JSF CDI etc... all is provided by a lightweight servlet container with great startup times.
Combination of both
So how do we combine both containers? The answer is simple, drop
and its dependencies :
- commons-beanutils.jar version 1.8.3 or above
- commons-codec.jar version 1.3 or above
- commons-collections.jar version 3.2 or above
- commons-io.jar version 1.4 or above
- groovy-all.jar version 1.7.2 or above
- scala-compiler.jar version 2.10.0-M2 or above
- scala-library.jar version 2.10.0-M2 or above
(Note if you use Maven then Maven will do the job for you) into your war WEB-INF/LIB and set following configuration entries:
This is the most important entry and under normal Servlet containers now we would be set and could start coding, however we have to set additional parameters for TomEE:
Those paths point to your source directories hosting the source files. (Note that the Ruby loader paths are only valid with the latest 1.0.5-SNAPSHOTS, 1.0.4 has no Ruby support)
Once done you can start coding in the code hosted at the respective directories.
More information about setting up Ext-Script can be found here.