I'm using Spring MVC 3 with Apache Tiles 3.
I want to add a custom title for one of my pages. I want this title to live in the specific view jsp and not in the layout jsp.
Here's what I'm doing:
Definition in tiles.xml
<definition name="availability" extends="base.definition">
<put-attribute name="title" expression="${requestScope.title}"/>
<put-attribute name="page" value="/WEB-INF/views/availability.jsp" />
</definition>
Here's the availability.jsp:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="title" value="Availability" scope="request"/>
Here's the layout.jsp (used by base.definition)
<title>App::<tiles:getAsString name='title' /></title>
This results in a null pointer exception in the tiles layer when rendering attribute.
I can set the title via model when the request goes to my controller as suggested here, but I would like to do this from within the view JSP and not the controller.
It looks like, the way the tiles composes and renders pages, this is not possible. Is that right?