Is it possible to tell the <h:outputStylesheet to load a file from servlet url ?
like http://my.company.com/MyServletName/jahdkhasdhasjkdha8d98yuifysduifsdh cause if I try something like
<h:outputStylesheet library="css"
name="http://my.company.com/MyServletName/jahdkhasdhasjkdha8d98yuifysduifsdh" target="head" />
where the
http://my.company.com/MyServletName/jahdkhasdhasjkdha8d98yuifysduifsdh
is a servlet that direct it to the right css file , it does not work… the <link tag is not being created
I need this cause when I’m trying to use
<link type="text/css" rel="stylesheet" href="http://my.company.com/MyServletName/jahdkhasdhasjkdha8d98yuifysduifsdh" />
the #{facesContext.externalContext.requestContextPath}'/ expression inside the css file are not getting translated into WebApp Name…
Thanks in advance!
No, you can’t. Even when it has worked, it’s the servlet who’s responsible for EL resolving, not the
<h:outputStylesheet>component.You need to solve the problem differently. I’d start by just putting all CSS dependencies, such as CSS images, in the very same folder as the CSS file itself and then reference them relatively. This way you don’t need to fiddle with the context path.
By the way, the
#{request.contextPath}is shorter.