Same answer applies here - use relative paths.

The problem with CSS and other resource files really stays the same -
no matter if you use JSF or not.

regards,

Martin

On 10/24/06, Ludovic Robinot <[EMAIL PROTECTED]> wrote:
Andrew Robinson a dit le 10/24/2006 06:50 AM:
> Why not just use a relative link with a leading slash '/'? Without the
> context root, the link would be above the projects, so you can just
> put the context root of the other servlet in the URL.
>
> As for getting the server name, there is no "one" server name, as the
> URL of a web server is not always the name of the computer hosting the
> web site. You can however get the URL of the server that the user
> requested for the current request/response. The HTTP header for this
> is 'SERVER_NAME'. This variable is also accessible through the
> HttpServletRequest.getServerName() variable.
>
> Assuming you are in a servlet environment (looks like you are), you
> would get the variable like so:
>
> 
((HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest()).getServerName()
>
>
> In EL:
>
> #{facesContext.externalContext.request.serverName}

I have a similar question. How to solve the same problem in external
files like the css files containing url()?

Do we have to use EL in CSS or javascript files and served them through jsf?

--
Ludovic



--

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

Reply via email to