ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Advanced SiteMesh
Subject:   JSF and Sitemesh
Date:   2004-11-15 03:14:54
From:   Gururaj
Hi,


I am trying to user sitemesh with JSF, I am facing a typical problem with sitemesh and JSF,
Can somebody please tell me where am I going wrong



my Decorator.jsp is as follow


<%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator"%>
<%@ taglib uri="http://www.opensymphony.com/sitemesh/page" prefix="page"%>


<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<page:applyDecorator page="/jsp/decorator/header.jsp" name="panel" title="menu"/>
</td>
</tr>
<tr>
<td>
<decorator:body/>
</td>
</tr>
</table>



and header.jsp is as follow


<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<f:view>
<table>
<tr>
<td>
<h:outputText id="userName" value="Test Value"/>
</td>
</tr>
</table>
</f:view>



my faces servlet mapping and sitemesh mappings are as follow (in web.xml)


<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<filter-mapping>


<filter-name>sitemesh</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>



If put f:view tag in header.jsp I get the following error
com.opensymphony.module.sitemesh.taglib.page.ApplyDecoratorTag.doEndTag(ApplyDecoratorTag.java:271)



instead if I remove all JSF tags like <f:view> and <h:outputText> then it works fine
I tried to apply the decorator using ýpage=faces/jsp/decorator/header.jspý in decorator.jsp, since faces servlet mapping uses faces/* (in web.xml)
any configuration problem or something else ??



One more thing is
Instead of <page:applyDecorator> if I use <%@ include file="jsp/decorator/header.jspý " %>
It is throwing faces context exception
Please help me


PS: please refer http://forums.java.sun.com/thread.jsp?thread=526351&forum=427&message=2807796
for the similar posting.


Thanks and Regards,
Gururaj Kulkarni
IonIdea Enterprise Solutions Pvt. Ltd.
#38-40, Export Promotion Industrial Park,
Whitefield, Bangalore - 560066.