Announcement Announcement Module
Collapse
No announcement yet.
Relative paths for stylesheets Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Relative paths for stylesheets

    My head.inc inclusion file contains a link to a stylesheet file "css/styles.css"

    This works in a default index.jsp page, but not in the pages forwarded from the controllers.
    Let's say I have a controller that responds to /reports/users.page request.

    The page that it eventually forwards to, e.g. report.jsp also includes the above stylesheet.
    Server is however trying to retrieve /reports/css/styles.css, which is one level below.
    This is not dependent on a value of alwaysFullPath property.

    I cannot use absolute path "/css/styles.css", because the actual webapp is under /websa URL on a server.

    Can I actually use relative paths for stylesheets, images and javascript? Or do I need to use absolute paths everywhere (with included webapp name) ?


    Thanks

    Matt

  • #2
    Use <c:url value="/css/styles.css"/> which will prepend the app root.

    Comment


    • #3
      Thanks a lot, that did the trick !

      Comment

      Working...
      X