Alexander Baetz wrote:
Hi,

ok, this is not really a struts question but we came to it while creating tiles pages. it might be that i'm thinking wrong.

scenario:
in writing a tiles template. there i want to include an external stylesheet x. when an action (domain/namespace/myAction.action) is executed the result creates a page that uses this stylesheet. now the problem: i want to avoid to include the stylesheet with the full path, including the domain. i would rather like to use the relative path. But how can i do that?

Correct me if i'm wrong, but the relative path differs, depending on the url of the action. how can i create a link to the stylesheet that works for all actions?


I often use:

<link type="text/css" rel="stylesheet" href="/css/main.css">
<link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/css/main.css">
<link type="text/css" rel="stylesheet" href="${initParam.css}/main.css">

where ${initParam.css} refers to an init param in web.xml (useful if it needs to change with the deployment, such as a version number)



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to