gamelan
Search EarthWeb
CodeGuru | Gamelan | Jars | Wireless | Discussions
Navigate developer.com
Architecture & Design  
Database  
Java
Languages & Tools
Microsoft & .NET
Open Source  
Project Management  
Security  
Techniques  
Voice  
Web Services  
Wireless/Mobile
XML  
Technology Jobs  

   Developer.com Webcasts:
  The Impact of Coding Standards and Code Reviews

  Project Management for the Developer

  Defining Your Own Software Development Methodology

  more Webcasts...




See the Winners!


Developer Jobs

Be a Commerce Partner
Calling Cards
Online Education
Find Software
Logo Design
Build a Server Rack
Promotional Gifts
Shop
Televisions
Server Racks
Promote Your Website
Baby Photo Contest
Car Donations
Dental Insurance
Holiday Gift Ideas

 


  Rethinking the Datacenter
Sponsored by HP
Today's datacenters need to increase utilization, get control over power and cooling costs, and align with business objectives. Download this eBook to learn about the challenges facing the data center in a world where digital information is growing at a torrid pace and costs are being held in check. Learn more. »
 
  Putting the Green into IT
Sponsored by HP
Electricity use in data centers is skyrocketing, sending energy bills through the roof, creating environmental concerns and generating negative publicity. "Going Green" means looking to technologies like virtualization, energy-efficient chips and racks, and implementing policies that extend beyond the data center. Learn more. »
 
  Managing the Modern Network
Sponsored by HP
In a global economy where information crosses the globe in an instant, and where Web-based applications power business, it's more important than ever to ensure your network is safe from threats and optimized to deliver the data your business needs. »
 
  Evaluating Software as a Service for Your Business
Sponsored by Webroot
Is Software as a Service just hype, or is something really going on here? See if your company can benefit as SaaS tries to change the face of the enterprise. »
 
  Is Your Disaster Recovery Plan Good Enough?
Sponsored by HP
Preparing for a disaster is more often than not part of the storage planning process, and it is one of the most difficult tasks, since it includes local hardware and software, networking equipment, and a test plan. Learn how to get disaster recovery right. »
 
Developer News -
SaaS Tool Offers Custom Database Development    May 9, 2008
Microsoft’s Automated Agent: Can We Talk?    May 7, 2008
Borland Finally Sells CodeGear    May 7, 2008
Red Hat Heads For The JON 2.0    May 7, 2008
Free Tech Newsletter -

Best Practices for Developing a Web Site: Checklists, Tips, Strategies & More. Download Exclusive eBook Now.

Tip: Use Tiles Decorations; Reduce Configuration
By David DeWolf

In case you haven't heard, the Apache Tiles framework, which gained popularity and widespread adoption as a Struts plugin, graduated into its own top-level Apache project in late 2006. The Apache Tiles project is now responsible for releasing and maintaining Tiles2, the next generation of the framework. As of this writing, Tiles 2.0.4 has been released as a beta quality release and several organizations have reported successful production deployments. A "General Availability" (GA) release should follow quickly.

Most developers familiar with the original Struts-Tiles framework (the one bundled with the popular Struts 1.1) will find very few differences between using Tiles 2.0.x and previous releases. In fact, the primary goal of the 2.0.x release series was to remove Struts dependencies and simplify its integration with other web frameworks. To most developers, these are architectural issues that will have little effect during deployment. Additionally, deprecated tags have been removed and several others have been renamed or tweaked to clarify their usage. Beyond the architectural and cosmetic changes to Tiles2, there is one enhancement that may alone make upgrading worth while—The "TilesDecorationFilter."

Perhaps the biggest issue with the original versions of Tiles was the configuration burden that it imposed. Prior to Tiles2, many deployments required either a unique "configuration" or XML configuration for every unique request. In many cases where tiles was being used for applying a consistant look and feel throughout a site, this resulted in significant duplication. In fact, in most cases, each definition was nearly identical—differing only by the fact that the configured tiles included a different JSP that would provide the page "content." The TilesDecortationFilter provides a standard mechanism for solving this problem.

The TilesDecorationFilter provides auto-configuration of tiles definitions. To use it, simply configure your filter to intercept any request to which you’d like to provide a standard look and feel. The filter will intercept the request, create a new templating definition that includes the standard set of tiles, configure the content page dynamically based on the original request, and render the definition. In many cases, the use of the decoration filter reduces the amount of XML configuration from one tiles definition per unique request to a single definition. This single definition then is applied to all requests.

The following example shows how to easily provide a standard look and feel in a web application using a MVC type web framework. In most cases, these applications dispatch to their render lifecycle by forwarding the request to a JSP. The filter configuration below will intercept all JSP requests that are forwarded to, configure the tiles definition called "standard" with an attribute called "body," and invoke that definition.



Click here for a larger image.

Figure 1: TilesDecorationFilter Definition

Figure 2: Filter Mapping

Using the TilesDecorationFilter can significantly reduce the amount of configuration in your web application. If you are looking for a templating engine that will provide a standard look and feel with minimal configuration, Tiles2 may well be your solution.

About the Author

David DeWolf is the chief technical architect and founder of Three Pillar Software, Inc. He works with mid-sized and Fortune 1000 companies to establish corporate standards that promote best practices and agile development. David has over eight years of commercial software development experience and is a member of the Apache Software Foundation's Struts, Tiles, and Portals projects. David actively participates in the Java Community Process as a member of the Java Portlet Specification Expert Group and is the author of various online publications.


Tools:
Add www.developer.com to your favorites
Add www.developer.com to your browser search box
IE 7 | Firefox 2.0 | Firefox 1.5.x
Receive news via our XML/RSS feed


Java Archives

Work With InterSystems. Not Separate Systems. Rapidly develop and deploy connectable applications.
Five Trends for Application Development. Download Your Complimentary Report. Exclusive. Act Now.
Generate Complete .NET Web Apps in Minutes . Download Iron Speed Designer today.
Whitepaper: Embeddable Content Platform for OEM's
Whitepaper: XML Processing in Applications--Take the Next Step



JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
Microsoft Article: HyperV-The Killer Feature in WinServer ‘08
Avaya Article: How to Feed Data into the Avaya Event Processor
Microsoft Article: Install What You Need with Win Server ‘08
HP eBook: Putting the Green into IT
Whitepaper: HP Integrated Citrix XenServer for HP ProLiant Servers
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 1
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 2--The Future of Concurrency
Avaya Article: Setting Up a SIP A/S Development Environment
IBM Article: How Cool Is Your Data Center?
Microsoft Article: Managing Virtual Machines with Microsoft System Center
HP eBook: Storage Networking , Part 1
Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Intel Video: Are Multi-core Processors Here to Stay?
On-Demand Webcast: Five Virtualization Trends to Watch
HP Video: Page Cost Calculator
Intel Video: APIs for Parallel Programming
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Sun Download: Solaris 8 Migration Assistant
Sybase Download: SQL Anywhere Developer Edition
Red Gate Download: SQL Backup Pro and free DBA Best Practices eBook
Red Gate Download: SQL Compare Pro 6
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
How-to-Article: Preparing for Hyper-Threading Technology and Dual Core Technology
eTouch PDF: Conquering the Tyranny of E-Mail and Word Processors
IBM Article: Collaborating in the High-Performance Workplace
HP Demo: StorageWorks EVA4400
Intel Featured Algorhythm: Intel Threading Building Blocks--The Pipeline Class
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES