October 11th, 2003, 04:29 AM
CSS in Servlet help (version 2!!)
..(i was informed with a database error when i posted the previous messages so i didn't know they were actually gonna post but with an EMPTY message in it!! :/... luckily i saved the post so i'll just paste it here again....this'd better work.. >.<)
This may be the simpliest thing to most of you but I'm just wondering if anyone can give me a little help on how i can call and use a CSS in a servlet...
Here's what i tried:
out.println("<link rel=\"alternate stylesheet\" href=\"someCSS.css\" type=\"text/css\" title = \"someCSS\">");
I have also tried putting the .css files inside different directories
I really don't know what's wrong, I did try searching through the forums but it's not leading me anywhere...
Anyone who can help would be greatly appreciated
The probability of someone watching you is proportional to the stupidity of your action
October 11th, 2003, 01:30 PM
Well, I would suggest using a web root relative url for the css file. Place the css file somewhere web accessible like
(WEB-INF is not web accessible). Then you can get to it by telling the browser to find it relative to the web root like this
out.println("<link rel=\"alternate stylesheet\" href=\"" + req.getContextPath() + "/someCSS.css\" type=\"text/css\" title = \"someCSS\">");