struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stone, Sam" <>
Subject Tiles 2 - How to dispatch to tiles servlet????
Date Mon, 04 Dec 2006 22:30:50 GMT
I am using tiles-core-2.0-SNAPSHOT.jar from Sep 2006.


I have a servlet MyServlet and also a servlet named tiles in the same
war file. Everything works if I do launch a jsp page that has a
tiles:insert in it. However, I'd like to dispatch directlry from
MyServlet to a tiles definition.


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


All the following ocde seems to work. The printlns dump out the expected
information. I just can't figure out how to transfer control to my tiles


            DefinitionsFactory definitionsFactory = null;            

            DefinitionsFactoryConfig definitionsConfig;


            definitionsConfig = new DefinitionsFactoryConfig();

            TilesContext stc = new



            /* load the tiles definitions */


            try {

                definitionsFactory =
TilesUtil.createDefinitionsFactory(stc, definitionsConfig);

                System.out.println("Tiles Definitions loaded!");

            } catch (DefinitionsFactoryException dfe) {

                System.out.println("Error reading tiles definitions
file: " +






                        ComponentDefinition definition =

                        System.out.println("definition=" + definition);


            catch (Exception de)






Following is from my web.xml:


<servlet id="Servlet_1159386011442">



<init-param id="InitParam_1159386019739">









  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message