  | 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-03 - By Emi Lu
Back
> here's the example: > > <package name="default" extends="tiles-default"> > ... > </package> > > see? it's enough that your packages extend tiles-default.
It works as well! That's nice! Thank you Robi.
I did: =========================== [1] deleted <result-types> <result-type name="tiles" class="org.apache.struts2.views.tiles.TilesResult"/> </result-types>
from struts.xml
[2] updated struts.xml:
from <package name="example" namespace="/example" extends="struts-default">
to <package name="example" namespace="/example" extends="tiles-default">
******************** I hope "tiles-default" supports/extends all default struts2 setup, right?
I mean, if package extends "tiles-default", all struts2 properties such as <result type="redirect-action">Menu</result> <result name="success" type="dispatcher">/Success.jsp </result> <result name="input" type="dispatcher">/Logon.jsp </result> <result name="error">/Logon.jsp</result> and other parameters will still work.
Cheers!
> > Emi Lu wrote: >> Thank you very much ! >> >> It works! >> >> >> Following Your comments, I did: >> >>>> ============= >>>> <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 >> >> Deleted from web.xml >> >> >>>> [2] <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 >> >> May I get an example? Is it for java action class extends tiles or >> web.xml file update, would you tell me how? >> >> For now, I did not change this section. >> >> >>>> [3] >>>> <action name="HelloWorld" class="example.HelloWorld"> >>>> <result name="success" type="tiles">TileHelloWorld</result> >>>> </action> >>>> >>>> to the struts.xml file >>> >>> ok >> >> no change. >> >> >>>> [4] <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.. >> >> rename to tile.xml; now the file is loaded auto-matically :) >> >> >> >>
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ To unsubscribe, e-mail: user-unsubscribe@(protected) For additional commands, e-mail: user-help@(protected)
|
|
 |