You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Henrik Bentel <hb...@gmail.com> on 2005/10/11 21:58:24 UTC
graphicImage and root context in portal
Hi
I have a feeling my question should be asked a different place, but
I'll ask here anyways.
Description:
I'm trying to use the graphicImage component (aka HtmlGraphicImageTag)
in a JSF portlet.
The portal serving the portlet runs as the root context of the server.
The portal is Liferay 3.6
So if I want to directly reference my webapp resources the URL's would
look like this:
http:HOSTIP/welcome.jsp and http:HOSTIP/styles.css
Problem:
In one of the JSP pages I use the GraphicImage Tag inside a Tree2
component to display images of folders.
My problem is the URLs generated in the HTML document.
>From this tag:
<t:graphicImage value="/images/yellow-folder-closed.png"
rendered="#{!t.nodeExpanded}" border="0"/>
I get:
<img id="irrelevantId" src="//images/yellow-folder-closed.png" border="0"/>
On firefox(and I assume maybe Internet Exploder) this doesn't work.
The double slash ruins it.
It works fine it you put the URL directly in the addressbar, like so:
http://HOSTIP//images/yellow-folder-closed.png , the browser resolves
this double slash fine.
But it seems inside a HTML document .. not soo much. Result is a missing image.
If I try to remove the first '/' the portal chockes cheetos like so:
java.lang.IllegalArgumentException: URL path must start with a '/' or
include '://'
at com.liferay.portlet.RenderResponseImpl.encodeURL(RenderResponseImpl.java:119)
at org.apache.myfaces.context.portlet.PortletExternalContextImpl.encodeResourceURL(PortletExternalContextImpl.java:197)
at org.apache.myfaces.renderkit.html.HtmlImageRendererBase.encodeEnd(HtmlImageRendererBase.java:69)
So it seems I must pass in an absolute path (or full server address)
as the value of the URL.
Short of doing full url, is there anything else I can do to make the
URLs correct.?
Does anyone have any experience with this inside a portal?
thanks
Henrik Bentel