Results 1 to 2 of 2

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

Hybrid View

  1. #1
    Join Date
    Jun 2012
    Posts
    5

    Default 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:
    Unbenannt.png

    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

  2. #2
    Join Date
    Jun 2012
    Posts
    5

    Default

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •