  | Mailing List | | Home | | Forum Home | | JBoss - Java Application Server | | Tomcat - JSP/Servlet container | | Struts - A MVC web framework | | iText - An open source PDF Java Library | | JDOM - JDOM XML Parser | | JSP - A mailing list about Java Server Pages specification and reference | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | |
Struts & Hibernate
|
|
|
  | | | Subject: Re: Tiles 2 setup with Struts2 | Subject: Re: Tiles 2 setup with Struts2 2007-10-02 - By Jason Deffenbaugh
Back You also need to add the jars that tiles requires:
copy the Tiles dependencies JARs: * Jakarta Commons BeanUtils 1.7.0 or above; * Jakarta Commons Digester 1.8 or above; * Jakarta Commons Logging (at least API) 1.1 or above
http://tiles.apache.org/getting_started.html
-Jason
On Tue, 2007-10-02 at 23:33 +0200, Roberto Nunnari wrote: > Hello Emi. > > see below my comments. > > > Emi Lu wrote: > > Hello, > > > > I looked at this page: > > > > http://struts.apache.org/2.x/docs/tiles-plugin.html > > > > Done: > > ============= > > [1] Added > > > > <dependency> > > <groupId>org.apache.struts</groupId> > > <artifactId>struts2-tiles-plugin</artifactId> > > <version>${version.tiles}</version> > > <scope>compile</scope> > > </dependency> > > > > to web.xml > > the above looks like maven stuff.. shouldn't be in web.xml > > > > > > > > [2] Added > > > > <result-types> > > <result-type name="tiles" > > class="org.apache.struts2.views.tiles.TilesResult"/> > > </result-types> > > > > to the struts.xml file's package section > > you could also extends tiles definition instead > > > > > > > > > > [3] Added > > > > <action name="HelloWorld" class="example.HelloWorld"> > > <result name="success" type="tiles">TileHelloWorld</result> > > </action> > > > > to the struts.xml file > > ok > > > > > > > > [4] Added > > <definition name="TileHelloWorld" template="/tiles/layout.jsp"> > > <put-attribute name="body" value="/HelloWorld.jsp"/> > > </definition> > > > > to tiles-defs.xml (this file is saved under /WEB-INF/) > > > > For struts2, where and how to notify the system to load the > > titles-defs.xml? I suppose that the system will find this file > > auto-matically? > > that should be in WEB-INF/tiles.xml and not tiles-defs.xml > unless you include it.. > > > > > > > > > > When I tried to access this page from URL, I always get the following > > exception (tomcat5.5.23): > > > > javax.servlet.ServletException: TileHelloWorld > > > > org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:515) > > org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher .java:419) > > > > > > root cause > > org.apache.tiles.definition.NoSuchDefinitionException: TileHelloWorld > > org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java :392) > > > > org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java :368) > > > > org.apache.struts2.views.tiles.TilesResult.doExecute(TilesResult.java:104) > > org.apache.struts2.dispatcher.StrutsResultSupport.execute (StrutsResultSupport.java:178) > > > > com.opensymphony.xwork2.DefaultActionInvocation.executeResult (DefaultActionInvocation.java:348) > > > > com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:253) > > > > > > > > Any clues, which step I did wrong? > > > > Thanks a lot! > > > > > > -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ > > To unsubscribe, e-mail: user-unsubscribe@(protected) > > For additional commands, e-mail: user-help@(protected) > > > -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ > To unsubscribe, e-mail: user-unsubscribe@(protected) > For additional commands, e-mail: user-help@(protected) >
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ To unsubscribe, e-mail: user-unsubscribe@(protected) For additional commands, e-mail: user-help@(protected)
|
|
 |