tiles-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Harrison" <rha...@gmail.com>
Subject Path from definition rendered as string
Date Tue, 02 Dec 2008 15:26:16 GMT
I have a Struts2 application: Struts version is 2.0.12 and Tiles is
2.0.4. Have also jars for commons-beanutil 1.8, digester 1.8, logging
1.04 and api 1.1.  IDE is MyEclipse Enterprise Workbench 6.5.1.

I have a "HelloWorld" action that calls a Tiles definition.  The
action (in struts.xml) is:
<?xml version="1.0" encoding="UTF-8"?>
    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
	<package name="default" extends="struts-default" namespace="/">
			<result-type name="tiles"
				class="org.apache.struts2.views.tiles.TilesResult" />

		<action name="HelloWorld" class="org.rochesterDeltas.tutorial.HelloWorld">
			<result type="tiles">MainPage</result>

and the Tiles definition (in tiles.xml) is:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE tiles-definitions PUBLIC
       "-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
    <definition name="MainPage" template="WEB-INF/tiles/template.jsp">
        <put-attribute name="pageTitle" value="Test Template Page #4" />
        <put-attribute name="header" value="WEB-INF/tiles/header.jsp" />
        <put-attribute name="navigationOne" value="WEB-INF/tiles/menuOne.jsp" />
        <put-attribute name="body" value="WEB-INF/tiles/home_body.jsp" />
        <put-attribute name="footer" value="WEB-INF/tiles/footer.jsp" />

Here is the template.jsp (all jsp files are under  WEB-INF/tiles/:

<?xml version="1.0" encoding="UTF-8"?>
<%@ taglib uri = "http://tiles.apache.org/tags-tiles" prefix="tiles"%>

	<title><tiles:getAsString name="pageTitle"/></title>
<style type="text/css">@import uri("../../delta.css");</style>

	<div id="bgcontain">
		<div id="container">
			<div id="header">
          <tiles:getAsString name="header" />
			<div id="leftwrap">
			<div id="content">
          <tiles:insertAttribute name="body" />
          <tiles:insertAttribute name="navigationOne" />
			<div id="rightbar">
		<div id="footer">
          <tiles:insertAttribute name="footer" />

When the action is called, it renders this page (with the correct text
in the title):


In other words, the template.jsp is being rendered, "getText is
working correctly, but, "insertAttribute" renders the path as a
string.  Can someone tell me where I'm wrong?


"If everyone is thinking alike, then, somebody isn't thinking! - George Patton

View raw message