Thanks for your response Nick :),

In fact we use Spring MVC, but the rendering is delegated to Tiles. For my code 
the render function will be called 2 times

....
// First call in RequestMapping action
TilesContainer container = 
TilesAccess.getContainer(request.getSession().getServletContext());
container.render("VIEW_NAME_02", request, response) 

...
// Second time with Spring MVC delegating
container.render("VIEW_NAME_01", request, response)  


So Nick, can you tell me what happens when we call 2 times render with 
different views? It's gonna render the first view and not the second one?

Thanks :x

P/S : As I said it worked with <tiles:insertDefinition name="VIEW_NAME_02"/> 
declared in VIEW_NAME_01.jsp, just now we want to render VIEW_NAME_02 with API 
( my team leader's idea, don't understand yet why he wants it )
_____

Tien Luong NGUYEN - 06.45.42.46.33
19 rue du Marc, 06600 Antibes



>________________________________
> From: Nicolas LE BAS <[email protected]>
>To: [email protected] 
>Sent: Monday, 27 February 2012, 16:50
>Subject: Re: [Tiles + Spring MVC] Render view with API
> 
>Hi,
>
>On 12-02-27 05:26 AM, Nguyen Tien Luong wrote:
>> - 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)
>>
>
>Well, first of all, Spring is not supposed to work that way. Spring 
>(specifically the class TilesView) is in charge of calling Tiles' API, you 
>shouldn't need to call it yourself. See the documentation here: 
>http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/mvc.html#mvc-ann-requestmapping-arguments,
> or perhaps you should ask the spring community for help.
>
>That being said, what are you trying to achieve with the API that you couldn't 
>do without?
>
>Nick
>
>
>

Reply via email to