|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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.. >.<)
Hi everyone! 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 Web\WEB-INF\classes\someCSS.css or Web\WEB-INF\someCSS.css or even Web\someCSS.css 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 ![]() Tomato
__________________
The probability of someone watching you is proportional to the stupidity of your action |
|
#2
|
|||
|
|||
|
Well, I would suggest using a web root relative url for the css file. Place the css file somewhere web accessible like
Web\someCSS.css (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\">"); |
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > CSS in Servlet help (version 2!!) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|