1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2002
    Rep Power

    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
    or even

    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
  2. #2
  3. No Profile Picture
    Clueless llama
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Feb 2001
    Lincoln, NE. USA
    Rep Power
    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\">");

    Before posting did you try:
    [ Javadocs | Google ]

IMN logo majestic logo threadwatch logo seochat tools logo