I should simplify the example:
*TitleHelper.java*
public interface TitleHelper {
void setTitle(String title);
String getTitle();
}
*content.jsp*
<%
TitleHelper th = (TitleHelper) request.getAttribute("th");
th.setTitle("My View");
%>
<div>
This is a content of a view.
</div>
*layout.jsp*
<html>
<head>
<%
TitleHelper th = new TitleHelperImpl();
// in the real world complicated state of TitleHelper is assigned here
request.setAttribute("th", th);
%>
<title><%= th.toString %></title>
</head>
<body>
<tiles:insertAttribute name="content" />
</body>
</html>
I hope now it is clear what I meant.
Daniel
On 11 April 2011 15:54, Antonio Petrelli <[email protected]> wrote:
> 2011/4/11 Daniel Stefaniuk <[email protected]>
>
> > It has nothing to do with JavaScript and it maybe related more to the JSP
> > rendering engine than to Tiles itself.
> >
>
> Dojo? Are you sure?
>
>
> > However, I wonder if there is a way to execute content, that is a JSP
> file
> > defined as "content" attribute, grab that content for example as a string
> > and then output it in the HTML body. Please, bear in mind that we are
> still
> > on the server side, not in a browser.
> >
>
> What do you mean with "execute" content? Is it Javascript?
>
> Antonio
>