Setting page title dynamically with tiles2 and spring mvc?

If by "I want to set the page title dynamically" you mean "I want to set the page title based on the tile that is being displayed and I want to use a tiles feature to do it" then.

Up vote 0 down vote favorite share g+ share fb share tw.

I've been asking myself this question for quite some time and I haven't found a nice solution for this on the web. So I am using Tiles2 and Spring MVC and I'd like to set the page title dynamically within the body tile. Is there a way?

My current solution is setting the title within the controller model. AddAttribute("pageTitle", "blubb"); and the doing a c:out in the template mvc spring title tiles tiles2 link|improve this question asked Mar 28 '11 at 17:01suicide19719 30% accept rate.

Tiles Technique If by "I want to set the page title dynamically" you mean "I want to set the page title based on the tile that is being displayed and I want to use a tiles feature to do it" then: Define a title property; something like this: Reference the pageTitle property in the layout for the page; something like this: Set the pageTitle property in any tile that matters; Variable Technique The simplest way to do this technique is to add an attribute to the model and to reference said attribute with an el expression. For example, You might do this in your controller: String pageTitle; pageTitle = "something"; Model. Add("PageTitle", pageTitle); Then reference the "PageTitle" attribute in your page like this: ${PageTitle} You can use c:out like this.

Sorry, I should have been more clear about that. Your solution works if I know exactly what the title is supposed to be before execution. But I like to change the title depending on the content that is retrieved by the controller.

Is there any way to do that from the "content" tile? – suicide Mar 28 '11 at 21:37.

Tiles. Xml: ... JSP: But this is only a good solution if your application has only one language.

This is working for me. Is there anything wrong with it? TILES: JSP.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions