tiles-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nguyen Tien Luong <tienluon...@yahoo.com>
Subject [Tiles + Spring MVC] Render view with API
Date Mon, 27 Feb 2012 10:26:16 GMT
   Hi Tiles User,

I am new in using Tiles and my situation is :

- I used Spring MVC + Tiles in my project.
- I have 2 views VIEW_NAME_01 and VIEW_NAME_02 declared in Tiles XML file config, and for
now it works good this way

@RequestMapping
public ModelAndView action(HttpServletRequest request, HttpServletResponse response) {
Map<String, Object> model = .... ;
return new ModelAndView("VIEW_NAME_01", model);
}

In the JSP of VIEW_NAME_01 I used <tiles:insertDefinition name="VIEW_NAME_02"/> to
include the view within VIEW_NAME_01 


- Now I want to include VIEW_NAME_02 in using API instead of tiles:insertDefinition tag.
I tried with TilesContainer and the code is ike that: 

@RequestMapping
public ModelAndView action(HttpServletRequest request, HttpServletResponse response) {

TilesContainer container = TilesAccess.getContainer(request.getSession().getServletContext()); 
container.render("VIEW_NAME_02", request, response);

Map<String, Object> model = .... ;
return new ModelAndView("VIEW_NAME_01", model);
}


Like this in my result I can only see the VIEW_NAME_02 is rendered (I also want to show VIEW_NAME_01)

So can someone can tell me how it works the render function of TilesContainer? And for my
case, how can I do?

All helps are kindly appreciated !
 
_____
Tien Luong NGUYEN - 06.45.42.46.33
19 rue du Marc, 06600 Antibes

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message