-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi
I'm just curious how i insert a server-root level external css file..
<?link rel="stylesheet" type="text/css" href="/rootOnServer/external.css"?>
Adds the application name in front.. like this;
<link rel="stylesheet" type="text/css" href="/contextRoot/rootOnServer/external.css">
...Thanks =)
i think you can use tilde
for example :
<link rel="stylesheet" type="text/css" href="~/contextRoot/rootOnServer/external.css">
hi guleri,
maybe I am wrong or do not understand.
Addressing a resource outside the webapps folder is normally not allowed.
The ROOT "/" normally addresses you application root (for example tomcat environment)
/tomcat/webapps/<your_app>/
That is for security reasons, because else anyone could adresse http://your_open_server/etc/<one of your config files>
/Horst
Hi again :)
Thanks, the tilde ~ was what i was looking for i think.. seems to work at my first test at least.
We have a lot of global resources on web-server-root.. like css images etc. i was not looking for files outside "public" web root on our server.
I must admit i i tried a little workaround first, having managers breathing down my neck..
<h:link type="text/css" href="/css/style.css" rel="stylesheet" />
Thanks!
Attach the web context to a resource that start with "/" is a common approach of J2EE application.
does this works?
<?link rel="stylesheet" type="text/css" href="/../external.css"?>
Asked: 2008-10-17 14:20:49 +0800
Seen: 623 times
Last updated: Oct 28 '08