You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Greg Reddin <gr...@fnf.com> on 2004/01/14 21:49:15 UTC

Re: tiles and struts-chain

Thank you very much for doing this.  I've looked at implementing Tiles 
support on several occasions and just haven't had the time to do it. 
Soon as I get a chance I'll download it and see how it works.

Greg

Joe Germuska wrote:
> I just committed a new command and a support class to the struts-chain 
> to support using Tiles with Struts chain.  I tried to explain it all in 
> the JavaDoc, but basically, if you plug this command in somewhere after 
> the action has executed (or something else has placed a ForwardConfig 
> into the chain context) and before PerformForward (or anything else 
> which expects to have a valid request dispatcher URI as the path of the 
> ForwardConfig which is in context), you'll get Tiles support.
> 
> There's one gotcha, which is that you have to use the new 
> org.apache.struts.chain.legacy.TilesPlugin, which does nothing more than 
> extend the original TilesPlugin but suppress its init method that fools 
> with the RequestProcessor.  Just change the package on the plug-in in 
> your struts config and you should be good to go.
> 
> Along the way I fixed a couple of bugs in other commands, and came upon 
> two related questions: when looking up either an ActionConfig or an 
> ExceptionHandler, we have two layers of logic in the core of Struts.  
> The first is simply matching a name to a config, but both lookups have 
> fallback strategies.  For ActionConfigs, Struts will look for the 
> "unknown" action if none matches exactly, and for ExceptionHandler, it 
> will walk the inheritance tree of the thrown exception to see if there 
> are registered handlers for any of its superclasses.
> 
> I copied the "unknown action" logic into struts-chain, but then when I 
> came upon the analogous problem in the chain's exception handling, I 
> thought again.  And actually, for exceptions, ActionMapping has a method 
> (findException) which is the home of the superclass-search logic.  Is 
> there a rationale behind having that in ActionMapping and not having it 
> in ActionConfig (ActionMapping's parent class)?
> 
> For the similar case in ModuleConfigImpl.findActionConfig() we actually 
> already have the logic which applies regular expressions to the action 
> path; is there any reason not to push the walk looking for 
> "unknown='true'" into there as well?
> 
> I have to say, I'm pretty excited to finally get my hands dirty with 
> struts-chain!
> 
> Joe
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org