Allen:
We use a practice somewhat like what you describe when roughing out prototype sites, or when a site has a pretty high amount of "static content." We've written a "TilesSmartForwardingAction" which we plug in as the "unknown" (default) action, and it parses the request path and converts that into a JSP. It then sets the derived value as a tiles attribute and forwards to a configured tile definition which is the template.
This lets our artists add pages to the site without having to muck with the struts-config, all the while keeping all page access going through Struts, so that should we later need to apply some logic, we can.
Using the Struts 1.2 "wildcard action path mapping," you could extend this further to support a few different basic layouts based on match-regions of the path.
Now that I look, I see that it ended up in the grab-bag of struts helpers that we put up online:
http://demo.jgsullivan.com/struts/TilesSmartForwardingAction.html
source code:
http://demo.jgsullivan.com/struts/xref/com/jgsullivan/struts/actions/TilesSmartForwardingAction.html
Javadoc: http://demo.jgsullivan.com/struts/apidocs/com/jgsullivan/struts/actions/TilesSmartForwardingAction.html
Hope that helps...
Joe
At 1:33 PM -0500 11/17/04, Tait, Allen wrote:
I'm interested in implementing the Struts and Tiles frameworks for a web
site (moving slowly toward web application). Is it possible, or even
recommended to design something similar to the following for the static
portions of a web site.
Assume Tiles have been defined to provide a common site wrapper. What's left is to select the body (jsp or Tile). Do this by defining a layout that will provide the site wrapper and receive that content/body (page or Tile) as a parameter. Then a generic "action" could grab the page requested from URL and put into common scope. The layout would grab the requested page name from the common scope and result in the requested page.
An approach like this seems to simplify the adding of new content pages by
eliminating configuration for tiles and struts. It seems this would also
help when implementing a content management system that would simply add the
content (body) portion of these pages. For example, once a body was added
to the site, a request for that page would be successful with no additional
configuration.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--
Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com "Narrow minds are weapons made for mass destruction" -The Ex
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]