wood burning stoves 2.0*
The moose likes Spring and the fly likes Spring Tiles, Multiple Controllers Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring Tiles, Multiple Controllers" Watch "Spring Tiles, Multiple Controllers" New topic
Author

Spring Tiles, Multiple Controllers

Dave Okey
Greenhorn

Joined: May 16, 2011
Posts: 3
Hi All,

Thanks in advance for any help as this has me stumped.

I'm experimenting with Spring MVC for an upcoming project. I'll need some web pages in the application to render multiple reusable "components" and figured that Tiles should help me accomplish this? Each component would have it's own controller.

The example I've put together is only partially working. It's a page with 3 tiles. The 3rd tile has a controller that's trying to return an ArrayList (via @ModelAttribute annotation) to the client but the ArrayList is empty when the view is included as a tile.

Here's the tiles setup in *-servlet.xml:




Here's my tiles config (tiles.xml):




Here's the JSP code behind the tile in question. The "widgetsList" expression is what is bound to the controller method but coming back empty when this view is included as a tile.




Here's the controller:





When I access the the view "widgets.jsp" directly, the "widgetsList" attribute gets populated, it's only when it's added as a tile that it returns nothing.

Thanks for any advice here.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Spring Tiles, Multiple Controllers