struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emi Lu <em...@encs.concordia.ca>
Subject Re: Tiles 2 setup with Struts2
Date Wed, 03 Oct 2007 18:00:11 GMT
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 :)




>> 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)

No such errors anymore, and I got my tiles pages displayed successfuly!

Thank you again!



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message