You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Dave Brondsema <da...@brondsema.net> on 2005/10/03 15:24:44 UTC

Re: JSF, Portlets and URLs

Henrik Bentel wrote:
> Hi
> 
> I have a  JSF portlet (running on Liferay) where I'm trying to use the
> tree2 component.
> It's a very simple tree with only a few nodes. I can get this tree
> compoenent  to display fine in a regular JSF webapp but when
> running as a portlet, it seems that URLs are treated very differently.
> 
> So I have something like this:
>    <t:tree2 id="clientTree" value="#{folderTracker.treeData}"
> var="node"  varNodeToggler="t"   showRootNode="false">
>        <f:facet name="foo-folder">
>             <h:panelGroup>
>                 <f:facet name="expand">
>                     <t:graphicImage value="/images/yellow-folder-open.png"
>                     rendered="#{t.nodeExpanded}" border="0"/>
>                 </f:facet>
>                   ...more stuff
> 
> The problem is that the t:graphicsImage value seems to resolve to a
> completely wrong url, and if I change it
> to relative path then the portal pukes.
> 
> Does anyone have a few tips and tricks you want to share related to
> combining JSF and portals? Especially on the topics of
> URLs/paths?
> 

I also am using JSF with portlets.

I'm pretty sure that you should use a full absolute URL with the domain
and everything.  I haven't had to do so yet, so I can't advise how to
construct it.

-- 
Dave Brondsema
Software Developer
Cornerstone University

Re: JSF, Portlets and URLs

Posted by Henrik Bentel <hb...@gmail.com>.
Correct, I've used that script before. Though not anymore, as it adds a
faces-context-factory to faces-config.xml which doesn't play nice.
The liferay deployment ant script just puts in the neccesary liferay hooks
(like the Liferay context listener entry), etc. It doesn't add missing
not-liferay-related content.

My problem was that the original web.xml was taken from liferay's example
jsf portlet webapp, which won't expect the application to access faces urls
directly. Hence the standard mapping for javax.faces.webapp.FacesServlet was
missing.


-Henrik

Re: JSF, Portlets and URLs

Posted by Tanju Erinmez <ta...@idparc.ch>.
Hi Henrik,

I think It shouldn't be necessary to prepare the web.xml manually. There is 
a deployment ant script available for 3.6.1 which does the necessary web.xml 
alterations and the deployment itself

http://www.liferay.com/web/guest/documentation/development/hot_deploy#2

I guess the mentioned example was just the predeployment variant hence the 
missing entries.

HTH,
Tanju

----- Original Message ----- 
From: Henrik Bentel
To: MyFaces Discussion
Sent: Tuesday, October 04, 2005 12:41 AM
Subject: Re: JSF, Portlets and URLs


I found my problem, or rather, I found an easy way to get it to work.

I hadn't assigned a servlet mapping to the FacesServlet in web.xml.
I started my JSF portlet app on the "sample_jsf_myfaces_portlet" example 
that comes with liferay, and this example didn't have the mapping  set.
I guess the assumption was that everything goes through the portal.

After I assigned the servlet mapping to the faces servlet, my tree2 
component renders just fine with all images, etc.
It also solved my problem with a popup which displays "non-portal" content 
pulled from the same webapp.

-Henrik 


Re: JSF, Portlets and URLs

Posted by Henrik Bentel <hb...@gmail.com>.
I found my problem, or rather, I found an easy way to get it to work.

I hadn't assigned a servlet mapping to the FacesServlet in web.xml.
I started my JSF portlet app on the "sample_jsf_myfaces_portlet" example
that comes with liferay, and this example didn't have the mapping set.
I guess the assumption was that everything goes through the portal.

After I assigned the servlet mapping to the faces servlet, my tree2
component renders just fine with all images, etc.
It also solved my problem with a popup which displays "non-portal" content
pulled from the same webapp.

-Henrik