Announcement Announcement Module
Collapse
No announcement yet.
How can i use resources like css or java script in a JSP-view (Spring 3 Portlet MVC) Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How can i use resources like css or java script in a JSP-view (Spring 3 Portlet MVC)

    Hey,

    I develop a portlet application on Websphere 7. And I use the Spring 3.1 MVC-Portlet framework.

    Everything is fine except the css includes.

    JSP-File:
    Attachment

    I put the css directory on the root path. Because i know the the WEB-INF directory is not readable (public perspective).

    In the jsp file i have to set the css path.
    PHP Code:
    <link rel="stylesheet" type="text/css" href="/css/formular.css" />  -->???? 
    Is that all?
    I get the follow server response:
    Code:
    "A WebGroup/Virtual Host to handle /css/formular.css has not been defined."
    How can i fix it?


    Thanks
    Alex
    Attached Files

  • #2
    The answer ist simple.

    I just use this TAG in the jsp file:
    Code:
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/formular.css" />
    Make sure the css or java scripts are readable
    Code:
    ROOT
    ---CSS <-- readable
    ---JavaScript <-- readable
    ---WEB-INF <-- Not readable without special changes
    ---META-INF

    Comment

    Working...
    X