Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring MVC 3.0 and Apache Tiles 2

I'm currently in a Spring MVC 3 based project, and found out about Apache Tiles 2 the other day,

I think Tiles 2 is a heck of framework that I could make good use in my project, but before I commit to it, I would like to know if it integrates well with Spring MVC 3, given that Tiles' inherent relationship with Struts. Spring also seems to have issues with some frameworks, so better careful than sorry I guess.

So, how's your experience with Spring, Spring MVC 3 and Tiles 2 together?

Thanks!

like image 304
Tom Tucker Avatar asked Sep 07 '10 00:09

Tom Tucker


2 Answers

Spring MVC and Tiles go great together. Spring MVC treats tiles definitions as views, and the two integrates smoothly. Start with the Spring Reference. There are quite a few examples out there to guide you.

like image 141
earldouglas Avatar answered Sep 21 '22 20:09

earldouglas


They integrate really well together. You can start with this example, really straightforward. You just need to configure your web-app-config.xml (Spring config), your tiles-defs.xml (Tiles config) and then you can start implementing your JSPs (using tiles tag).

If you're using Maven, you just need to add those dependencies to your Spring project for Tiles2:

    <dependency>
        <groupId>org.apache.tiles</groupId>
        <artifactId>tiles-jsp</artifactId>
        <version>2.2.2</version>
    </dependency>

    <dependency>
        <groupId>org.apache.tiles</groupId>
        <artifactId>tiles-template</artifactId>
        <version>2.2.2</version>
    </dependency>
like image 23
sebarmeli Avatar answered Sep 20 '22 20:09

sebarmeli