This content has been marked as final.
Show 5 replies
-
1. Re: Where to put the Facelets templates when my app xhtml's are in subdirectories
tom_goring May 8, 2008 5:33 PM (in response to medibadge)Why not refer to as
/layout/template.xhtml
thats what I do.
-
2. Re: Where to put the Facelets templates when my app xhtml's are in subdirectories
medibadge May 8, 2008 6:27 PM (in response to medibadge)Thank you Tom, that works.
However, this fails when my xhtml is down one directory:
<img src="/img/runningon_seamlogo.gif"/>
But it works if I do:
<img src="../img/runningon_seamlogo.gif"/>
-
3. Re: Where to put the Facelets templates when my app xhtml's are in subdirectories
tom_goring May 8, 2008 6:43 PM (in response to medibadge)For external references do...
<img src="#{facesContext.externalContext.requestContextPath}/img/ajax-logo.jpg"/>
-
4. Re: Where to put the Facelets templates when my app xhtml's are in subdirectories
medibadge May 8, 2008 6:59 PM (in response to medibadge)Thanks again, everything is working fine.
This also works:
<h:graphicImage url="/img/runningon_seamlogo.gif"/>
-
5. Re: Where to put the Facelets templates when my app xhtml's are in subdirectories
www.supernovasoftware.com May 8, 2008 7:03 PM (in response to medibadge)I use the following.
@Name("basePathBean") public class BasePath { @SuppressWarnings("unused") @Out(scope = ScopeType.SESSION, required = false) private String basePath; @In private FacesContext facesContext; @Factory("basePath") public void loadBasePath() { HttpServletRequest request = (HttpServletRequest) facesContext.getExternalContext().getRequest(); basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath() + "/"; } }
<html> <head> <base href="#{basePath}" />