You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tiles.apache.org by doktora v <do...@gmail.com> on 2007/11/16 21:34:05 UTC

tiles2: inject bean via putAttribute

Hi,

When I try the code below and in "layout.jsp" I do

<tiles:insertAttribute name="bodyContent"/>

the rendered html displays "${bodyContent}" rather than the expected
"Body Content defined by an el".

Am I doing something wrong, or is this not working yet (I'm using
tiles 2.0.5 with struts 1.3.8).



testput.jsp
----------------------
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>

<c:set var="bodyContent" value="Body Content defined by and el" />

<tiles:insertTemplate template="/layout.jsp">
  <tiles:putAttribute name="title"  value="This is the title." />
  <tiles:putAttribute name="header" value="/header.jsp" />
  <tiles:putAttribute name="body"   value="${bodyContent}" />
</tiles:insertTemplate>

Re: tiles2: inject bean via putAttribute

Posted by Antonio Petrelli <an...@gmail.com>.
2007/11/16, doktora v <do...@gmail.com>:
>
> the rendered html displays "${bodyContent}" rather than the expected
> "Body Content defined by an el".



This usually happens when you use a servlet version before 2.4 specified in
your web.xml, or if you use a container not supporting JSP 2.0.

Antonio