#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2002
    Posts
    2
    Rep Power
    0

    urgent..how to attach .css or .xss files to .jsp pages


    Hi,

    I have a jsp page and a separate .css and .xss ´files.
    Now i want to attach the .css files to the .jsp page.

    How can i do this..

    Can anyone give me an example of this..

    And also where exactly should i place the .css files for jsp pages to recognize..

    Any help is appreciated..
  2. #2
  3. No Profile Picture
    Moderator =(8^(|)
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Feb 2002
    Location
    Sacramento, CA
    Posts
    1,710
    Rep Power
    14
    Do it exactly the same way you would for html (use a <link> tag). The jsp page gets sent the browser as html, so for stylesheets they're functionaly no different.
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2002
    Location
    New York City
    Posts
    1
    Rep Power
    0
    Hi,

    Pretty much the same way you would in a static html file

    i.e.

    <link rel="stylesheet" type="text/css" href="styles/mystyles.css" title="Default">

    Hope this helps,

    Jim
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2002
    Posts
    2
    Rep Power
    0
    Hi,
    can you send me a complete working example with a very simple jsp and a css file or .xss file attached to it..

    And how the elements of the .css are applied to the jsp controls..
  8. #5
  9. No Profile Picture
    Moderator =(8^(|)
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Feb 2002
    Location
    Sacramento, CA
    Posts
    1,710
    Rep Power
    14
    Code:
    <%@ page language="java" %>
    <% String test = "test"; %>
    <html>
    <head>
    <link rel="stylesheet" type="text/css" href="styles/mystyles.css" title="Default">
    </head>
    <body>
    <p class="test_class"><%= test %></p>
    </body>
    </html>
  10. #6
  11. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2002
    Posts
    1
    Rep Power
    0
    Use the new stylesheet importer!

    Originally posted by bricker42
    Code:
    <%@ page language="java" %>
    <% String test = "test"; %>
    <html>
    <head>
    <style type="text/css">
       @import url('master.css')
    </style>
    </head>
    <body>
    <p class="test_class"><%= test %></p>
    </body>
    </html>

IMN logo majestic logo threadwatch logo seochat tools logo