struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From crueg...@speakeasy.net
Subject getting web app context name in Struts
Date Tue, 19 Nov 2002 21:50:41 GMT

What is the Struts way to reference a CSS stylesheet
file and Javascript files such that the web application
context name will always be prepended to the files so
that they resolve properly?
(just like the <html:link page="/mypage.jsp"> construct
 prepends the context name in the generated page)

For example, suppose I deploy my webapp under 2 different
contexts "foo" and "bar" and I have a JSP with tags:

<head>
<link href="/styles.css" rel="stylesheet">
</head>

and 
<script language="JavaScript" src="/js/myfunctions.js"
</script>

such that, when deploying under context "foo" for example,
these tags would resolve to:

<head>
<link href="/foo/styles.css" rel="stylesheet">
</head>

and 

<script language="JavaScript" src="/foo/js/myfunctions.js"
</script>




--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message