I just started using JSF, trying to get MyFaces' Tiles integration to work.
So I created a layout page which uses tiles:insert to include the mainbar,
the sidebar and the content pane. In my tiles definition file I have a base
definition which all other definitions - two so far - extend.

Here's my tiles definition file:

<tiles-definitions>
 <definition name="/ews.base" path="/template/layout.jsp" id="basePage">
  <put name="mainNavigation" value="/common/mainNavigation.jsp"
type="page"/>
  <put name="sideActions" value="/common/sideActions.jsp" type="page"/>
  <put name="content" value="/common/empty.jsp" type="page"/>
 </definition>
 <definition name="/common/startPage.tiles" extends="/ews.base"
id="startPage">
  <put name="content" value="/startPage.jsp" type="page"/>
 </definition>
 <definition name="/organization/searchForm.tiles" extends="/ews.base"
id="organizationSearchForm">
  <put name="content" value="/organization/searchForm.jsp" type="page"/>
 </definition>
</tiles-definitions>

A <c:redirect url="common/startPage.jsf"/> will produce the desired effect,
i.e. the start page is composed correctly and I can see the message
startPage.jsp produces via <h:outputText/>.

And here's the catch: if I do a <c:redirect
url="organization/searchForm.jsf"/> I get a page with mainNavigation.jsp and
sideActions.jsp correctly included and translated into HTML, yet the content
of organization/searchForm.jsp is copied _verbatim_ into the HTML page. This
means that I can see the JSP code from organization/searchForm.jsp in the
generated page's source code.

I started playing around with the contents of startPage.jsp and
organization/searchForm.jsp and ended up swapping it, i.e I copied
startPage.jsp's JSP code into organization/searchForm.jsp and vice versa. Lo
and behold: I can see my organizationSearchForm on the start page, and
organization/searchForm.jsp is still copied verbatim into the generated HTML
output. So the problem _seems_ to be the tiles definition
/organization/searchForm.tiles itself and _not_ the JSP content in
organization/searchForm.jsp.

So could anyone give me a clue what is going on here since I am on the verge
of throwing up after staring at this phenomenon for the last four days? I am
using myfaces-1.0.9 in JBoss 4.0.2 under JDK 1.4.2_08 and any help would be
_greatly_ appreciated.

Cheers,

Olaf
--------------------------------------------
Easynet GmbH (http://www.de.easynet.net)
Olaf Bergner, System Integrations
Harburger Schlossstrasse 1, D-21079 Hamburg
fon: +49-40-77175-434, fax: +49-40-77175-519
# Easynet is part of the easynet group plc (www.Easynetgroup.net)


Reply via email to