RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX


Apache Shale Takes JavaServer Faces to the Next Level : Page 4

Apache Shale, the newest sibling of the Struts framework, leverages JavaServer Faces to enable componentized presentation-tier development. Get started with Shale's Dialog Manager, Validations, and JNDI services.


A Direct Line to JNDI

JNDI offers broad coverage of the directory services access that applications require. Apache Shale's JNDI module is not a very extensive JNDI implementation. It focuses on providing access to the values of properties and resources defined in /WEB-INF/web.xml. Stated simply, this means Apache Shale enables the following:
  • You can define environment entry values using <env-entry> in web.xml, and Shale will provide access to them when the #{jndi.XXXX} expression (where XXXX is the name of the entry in web.xml) is used in JSP or its backing bean.
  • You can define resources using <resource-ref> in web.xml, and Shale will create the resources on the fly when value binding is performed based on this definition.

The Launch Party application uses the first feature to determine whether an application is running in debug mode. The debugMode environment entry is defined in web.xml (as shown in Listing 10) and then used in all JSP pages:

    <description>Flag indicating whether we run in debug mode</description>

Listing 10. debugMode Environment Entry in Web.xml

Look out for <h:outputText value="*** DEBUG MODE ***" rendered="#{jndi.debugMode}"/> in all JSP pages.

Still Just the Beginning

This article has covered just the tip of the iceberg. Shale's complete capabilities have far-reaching benefits for your JSF-based Web applications. For instance, Clay integration provides componentized JSP pages to your JSF application. I believe Shale will do for JSF, what Struts did for MVC2.

Gautam Shah has been developing large, complex applications for over a decade, including solutions that enable information sharing between government entities. He has varied expertise in J2EE, .NET, open source solutions, and various integration platforms such as BizTalk, WebMethods, and WebSphere Business Integration Server.
Email AuthorEmail Author
Close Icon
Thanks for your registration, follow us on our social networks to keep up-to-date