@Emi Lu, are you sure? I will try tiles 2.0.7 if I don't get any fix from the struts users list. May be someone there has a fix for it. But thanks for the prompt reply. I appreciate it.
On Mon, Nov 22, 2010 at 11:41 AM, Emi Lu <[email protected]> wrote: > We have Struts 2, Spring 2.5.6 working peacefully together and >> > > > I wanted to add Tiles 2.2 on to the stack to experiment with it. >> > > If I remember correctly, "tiles2.2.x & tiles2.1.x" does not support > struts2! > > You will have to use tiles2.0.7 instead. Otherwise, > UnresolvingLocalDefinitionFactory Exception will arise. > > -- > Lu Ying > > > added dependencies in maven and they are all >> >> available. I am following the instructions on the Apache Tiles website >> and created a Listener and everything. Here's my configuration. >> >> *_Environment_* : >> >> Tomcat 6.0.29 >> Java(TM) SE Runtime Environment (build 1.6.0_22-b04-307-10M3261) >> >> > > > >> _*My web.xml *_*:* >> / >> / >> <filter> >> <filter-name>struts2</filter-name> >> >> <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class> >> </filter> >> >> <filter-mapping> >> <filter-name>struts2</filter-name> >> <url-pattern>/*</url-pattern> >> </filter-mapping> >> >> <listener> >> >> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> >> </listener> >> / >> / >> /* <listener>*/ >> /* <listener-class>com.blablabla.MyTilesListener</listener-class>*/ >> /* </listener>*/ >> >> *_Here's my /WEB-INF/tiles.xml_* >> *_ >> _* >> / <definition name="doc.mainLayout" >> template="/tiles/layout/classicLayout.jsp">/ >> / <put-attribute name="title" value="Electronic Submission of Medical >> Documentation (esMD)" />/ >> / <put-attribute name="header" value="/tiles/layout/tiles-header.jsp" />/ >> / <put-attribute name="body" value="/tiles/layout/tiles-body.jsp" />/ >> / <put-attribute name="footer" value="/tiles/layout/tiles-footer.jsp" />/ >> / </definition>/ >> / / >> / <definition name="*_LoginPage_*" extends="doc.mainLayout">/ >> / <put-attribute name="body" value="/tiles/LoginBody.jsp"/>/ >> / </definition>/ >> / >> / >> /*_My struts.xml_*/ >> / >> / >> / >> <package name="default" namespace="/" extends="struts-default"> <!-- >> "tiles-default" package cannot be found in tiles 2.2 so I changed it --> >> / >> <action name="Login"> >> / >> / >> / >> / >> <result>*_LoginPage_*</result> >> / >> / >> </action> >> / >> </package> >> >> / >> >> /*_MyTilesListener_*/ >> >> public class MyTilesListener extends AbstractTilesListener { >> >> protected TilesInitializer createTilesInitializer() { >> return new MyCustomTilesInitializer(); >> } >> } >> >> *_MyCustomTilesInitializer_* >> >> public class MyCustomTilesInitializer extends BasicTilesInitializer { >> >> /** {...@inheritdoc} */ >> @Override >> protected AbstractTilesContainerFactory createContainerFactory( >> TilesApplicationContext context) { >> return new MyTilesContainerFactory(); >> } >> } >> >> *_MyTilesContainerFactory_* >> >> public class MyTilesContainerFactory extends BasicTilesContainerFactory{ >> @Override >> protected List<URL> getSourceURLs(TilesApplicationContext >> tilesApplicationContext, >> TilesRequestContextFactory tilesRequestContextFactory) { >> >> List<URL> urls = null; >> >> try { >> urls = new ArrayList<URL>(); >> >> urls.add(tilesApplicationContext.getResource("/WEB-INF/tiles.xml")); >> } catch(Exception exception) { >> >> } >> >> return urls; >> } >> } >> >> *_This is the error we get: _* >> *_ >> _* >> *_ >> >> >> HTTP Status 404 - /LoginPage >> >> ------------------------------------------------------------------------ >> >> *type* Status report >> >> *message* _/LoginPage_ >> >> *description* _The requested resource (/LoginPage) is not available._ >> >> ------------------------------------------------------------------------ >> >> >> Apache Tomcat/6.0.29 >> >> _* >> >> *_ServerLog _* : >> >> 388 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] INFO >> org.apache.tiles.context.AbstractTilesApplicationContextFactory - >> Initializing Tiles2 application context. . . >> 392 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] WARN >> org.apache.tiles.context.ChainedTilesApplicationContextFactory - Cannot >> find TilesContextFactory class >> org.apache.tiles.portlet.context.PortletTilesApplicationContextFactory >> 392 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] INFO >> org.apache.tiles.context.AbstractTilesApplicationContextFactory - >> Finished initializing Tiles2 application context. >> 392 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] WARN >> org.apache.tiles.context.ChainedTilesApplicationContextFactory - Cannot >> find TilesContextFactory class >> org.apache.tiles.portlet.context.PortletTilesApplicationContextFactory >> 449 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] INFO >> org.apache.tiles.access.TilesAccess - Publishing TilesContext for >> context: org.apache.tiles.servlet.context.ServletTilesApplicationContext >> >> >> Can someone give me a direction to fix this please. Thanks! >> >> >> -- >> Cheers, >> John >> >> P.S: I also attached my pom.xml dependencies to give you a complete >> picture. >> > > -- Cheers, John
