How are the rest of you doing this?


we use:
<link href="${pageContext.request.contextPath}/css/stile.css" rel="stylesheet" type="text/css">

in JSF EL we use instead:

#{facesContext.externalContext.requestContextPath}


and, finally, in javascript:

location.pathname == ('/' + location.pathname.split('/')[1]) ? "" : '/' + location.pathname.split('/')[1];


We use often these functions because almost all our projects, when are in development run on a subdir (localhost:8084/project on Tomcat/NetBeans), but in production run on a rootdir (project.istitutodeglinnocenti.it on Apache 2.0/Tomcat/mod_jk)

see for example www.istitutodeglinnocenti.it, quite completely made with JSF.

--
Francesco Consumi
Ufficio Sistemi informativi
Istituto degli Innocenti
Piazza SS.Annunziata, 12
50122 Firenze
consumi at istitutodeglinnocenti.it
Tel. +39 055 2037320
ICQ# 12516133


Reply via email to