You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Stefan Krompaß <my...@web.de> on 2003/04/09 10:55:51 UTC
Problem with Tiles
Hi!
I want a JSP (root.jsp) to be built from several JSP-parts and therefore I'm using Tiles. But my problem is: I get a NullpointerException and I don't know, why...
My source:
root.jsp:
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<html:html locale="true">
<body>
<tiles:insert attribute="navigation">
<hr/>
<tiles:insert attribute='main'/>
</body>
</html:html>
struts-config.xml:
<plug-in className="org.apache.struts.tiles.TilesPlugin">
<set-property property="definitions-config" value="/WEB-INF/tiles-defs.xml"/>
<set-property property="definitions-parser-validate" value="true"/>
<set-property property="moduleAware" value="true"/>
</plug-in>
tiles-def.xml:
<tiles-definitions>
<definition name="rootLayout" path="/root.jsp">
<put name="main" value="/main_menu.jsp"/>
<put name="navigation" value="/navigation.jsp"/>
</definition>
</tiles-definitions>
main_menu.jsp and navigation.jsp exist in the same directory as root.jsp.
Thanks for help!
Stefan
______________________________________________________________________________
UNICEF bittet um Spenden fur die Kinder im Irak! Hier online an
UNICEF spenden: https://spenden.web.de/unicef/special/?mc=021101
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Problem with Tiles
Posted by Alessio <mo...@dit.unitn.it>.
You have two way for solve your problem:
first ->
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<tiles:insert page="/root.jsp.jsp" flush="true">
<put name="main" value="/main_menu.jsp"/>
<put name="navigation" value="/navigation.jsp"/>
</tiles:insert>
second ->
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<tiles:insert definition="rootLayout" flush="true" />
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org