struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David H. DeWolf" <ddew...@apache.org>
Subject Re: Tiles 2 - How to dispatch to tiles servlet????
Date Tue, 05 Dec 2006 13:44:22 GMT
Moving to Struts Users list, please reply there.

Antonio Petrelli wrote:
> First of all this is a typical question to be submitted in Struts Users 
> mailing list.
> Anyway, since Tiles 2 is under development, I will answer anyway.
> 
> Stone, Sam ha scritto:
>> I can instantiate the DefinitionsFactory. I can get a
>> ComponentDefinition OK. I cannot figure out how to forward the request
>> from MyServlet to dispatch to my tiles servlet. Any help is greatly
>> appreciated.
>>   
> Err... you can't, since TilesServlet does not accept connections (it is 
> used without a servlet-mapping).
> Anyway you can forward to (or include) your definition.
> 
> <snip>
>    ComponentContext context = 
> TilesAccess.getContainer(request.getSession().getServletContext())
>            .render(request, response, "my.definition.name");
> </snip>

Just to avoid confusion, I don't think Antonio meant to imply that the 
Container.render returns a ComponentContext.

TilesContainer tc = TilesAccess.getContainer(servletContext)
ComponentContext context = tc.getComponentContext(req, res);
// do something with the component context if needed,
tc.render(req, res, "my.definition.name");


David

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

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


Mime
View raw message