tiles-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From talkative <talkativecr...@gmail.com>
Subject Tiles 2 (v 2.0.4) with Struts 2 (v2.0.9) Integration Issues
Date Thu, 18 Oct 2007 00:51:39 GMT

I am trying to integrate Tiles 2 (v 2.0.4) integration with Struts 2 (v2.0.9)
and I'm getting errors, following is the snippet:
______________________________________________________________________________________

org.apache.commons.logging.impl.Jdk14Logger error Error executing tag:
Attribute 'header' not found.
                                 org.apache.tiles.TilesException: Attribute
'header' not found.
	at
org.apache.tiles.jsp.taglib.InsertAttributeTag.render(InsertAttributeTag.java:112)
	at
org.apache.tiles.jsp.taglib.RenderTagSupport.execute(RenderTagSupport.java:171)
	at
org.apache.tiles.jsp.taglib.RoleSecurityTagSupport.doEndTag(RoleSecurityTagSupport.java:75)
	at
org.apache.tiles.jsp.taglib.ContainerTagSupport.doEndTag(ContainerTagSupport.java:80)

RoleSecurityT E org.apache.commons.logging.impl.Jdk14Logger error Error
executing tag: Attribute 'body' not found.
                                 org.apache.tiles.TilesException: Attribute
'body' not found.
	at
org.apache.tiles.jsp.taglib.InsertAttributeTag.render(InsertAttributeTag.java:112)
	at
org.apache.tiles.jsp.taglib.RenderTagSupport.execute(RenderTagSupport.java:171)
	at
org.apache.tiles.jsp.taglib.RoleSecurityTagSupport.doEndTag(RoleSecurityTagSupport.java:75)
	at
org.apache.tiles.jsp.taglib.ContainerTagSupport.doEndTag(ContainerTagSupport.java:80)
	at
com.ibm._jsp._layout._jspx_meth_tiles_insertAttribute_2(_layout.java:194)
______________________________________________________________________________________


To integrate tiles 2 with struts 2, I did following changes in my
application:

Added following files to WEB-INF/lib
*struts2-tiles-plugin-2.0.9.jar
*tiles-api-2.0.4.jar
*tiles-core-2.0.4.jar
*tiles-jsp-2.0.4.jar


Updated Struts.xml:
<package name="default" extends="tiles-default">

Updated web.xml with:

<listener>
 
<listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class>
</listener>
<context-param>
        <param-name>
          org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG
        </param-name>
        <param-value>
          /WEB-INF/tiles.xml
        </param-value>
    </context-param>

Addded tiles.xml under WEB-INF like

<?xml version="1.0" encoding="ISO-8859-1" ?>

 <!DOCTYPE tiles-definitions PUBLIC
       "-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
       "http://tiles.apache.org/dtds/tiles-config_2_0.dtd">

<tiles-definitions>
<definition name="my.homepage" template="/layout.jsp">
  <put-attribute name="title" value="title name" />
  <put-attribute name="header" value="/header.jsp" />
  <put-attribute name="body" value="/body.jsp" /> 
</definition>
</tiles-definitions>


Added layout.jsp, like:
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
<html>
<head>
    <title><tiles:getAsString name="title"/></title>
</head>

<body>

<table border="0" width="100%" id="table1" cellspacing="0" cellpadding="0">
	<tr>
		<td width="5%">&nbsp;</td>
		<td width="80%">		
				
		<tiles:insertAttribute name="header" />
		
		</td>
		<td width="5%">&nbsp;</td>
	</tr>	
	<tr>
		<td width="5%">&nbsp;</td>
		<td width="80%">				
		<tiles:insertAttribute name="body"/>
		
		</td>
		<td width="5%">&nbsp;</td>
	</tr>
</table>
</body>
</html>

_________________________________________________________________________________________

Am I missing something ??? :confused:

Kindly guide me in right direction to fix the issues

Thanks in anticipation
 

-- 
View this message in context: http://www.nabble.com/Tiles-2-%28v-2.0.4%29-with-Struts-2-%28v2.0.9%29-Integration-Issues-tf4644265.html#a13265988
Sent from the tiles users mailing list archive at Nabble.com.


Mime
View raw message