Hi
I'm porting an existing application to Weblogic Portal 10. This
application uses JSF, Tomahawk and tiles.
I was wondering if anyone has experience using JSF/My Faces and Tiles in
a portlet. I am using Weblogic 10 with the versions of JSF RI and struts
which are bundled with Weblogic 10 plus Tomahawk 1.1.6. I am using the
tomahawk JspTilesViewHandlerImpl as the application view handler
I am having trouble accessing stuff which is defined in the tiles XML
file via a portlet. I therefore cooked up a simple example to test in
detail what is going on:
<%@ page language="java"
contentType="text/html;charset=UTF-8"
errorPage="/cfmu-error_portlet.jsp"%>
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@ taglib prefix="tiles" uri="http://struts.apache.org/tags-tiles"%>
<%@ taglib prefix="naming"
uri="http://bea.com/faces/adapter/tags-naming" %>
<f:view>
<naming:namingContainer/>
<h3>Portlet-Test</h3>
<table>
<tr><td><jsp:include page="body.jsp" /></td></tr>
<tr><td><jsp:include page="footer.jsp" /></td></tr>
<tr><td><tiles:insert attribute="body" flush="false"/></td></tr>
<tr><td><tiles:insert attribute="footer"
flush="false"/></td></tr>
</table>
</f:view>
<definition name="/pages/portlet-test.tiles"
path="/tiles/portlet-test/layout.jsp">
<put name="body" value="/tiles/portlet-test/body.jsp" />
<put name="footer" value="/tiles/portlet-test/footer.jsp"/>
</definition>
When I access the pages directly (i.e. not through a portlet) through
the tiles definitions I have no problems.
http://localhost:7001/pages/portlet-test.faces
It also works when I set up the portlet to access the layout.jsp
directly
<netuix:content>
<netuix:facesContent contentUri="/tiles/portlet-test/layout.faces"
requestAttrPersistence="none"/>
</netuix:content>
It works as expected, if however I set up the portlet to go through the
tiles definition:
<netuix:content>
<netuix:facesContent contentUri="/pages/portlet-test.faces"
requestAttrPersistence="none"/>
</netuix:content>
This does not work no content is generated. Weblogic reports an error
that it cannot find the gridlayout.jsp, which controls the portlet
layout, however I think this error message is misleading and actually it
cannot load this JSP because there is a problem with the portlet's
content, because if I switch the portlet to point to the JSP directly I
do not get this error.
So it looks like the tiles lookup in JspTilesViewHandlerImpl may be
broken when accessed through the portal, Could this be something to do
with when filters are being triggered?
At the moment I have a workaround where for every portlet I have a
wrapper.jsp that implements the stuff done in the tiles.xml file
<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="tiles" uri="http://struts.apache.org/tags-tiles"%>
<tiles:insert page="layout.jsp" flush="false">
<tiles:put name="body" value="body.jsp" />
<tiles:put name="footer" value="footer.jsp" />
</tiles:insert>
This works fine, and unblocks the rest of my work, but it is nod ideal
and I would like to be able to use the tiles.xml as normal anyone any
ideas?
Thanks in advance
Sandy
____
This message and any files transmitted with it are legally privileged and
intended for the sole use of the individual(s) or entity to whom they are
addressed. If you are not the intended recipient, please notify the sender by
reply and delete the message and any attachments from your system. Any
unauthorised use or disclosure of the content of this message is strictly
prohibited and may be unlawful.
Nothing in this e-mail message amounts to a contractual or legal commitment on
the part of EUROCONTROL, unless it is confirmed by appropriately signed hard
copy.
Any views expressed in this message are those of the sender.