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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to