Announcement Announcement Module
Collapse
No announcement yet.
No Mapping CSS or Image Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • No Mapping CSS or Image

    hi Guys! I could not find the topic through search forum future. Please help

    I have a siginin.jsp page, and it will use css file which locate at /myapp/WebContent/WEB-INF/jsp/signin.jsp
    and sigin.css at /myapp/WebContent/WEB-INF/css/signin.css
    and logo.gif at /myapp/WebContent/WEB-INF/pics/logo.gif

    This is my signin.jsp page.

    <%@ include file="/WEB-INF/jsp/include.jsp" %>
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Something</title>

    <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/WebContent/WEB-INF/css/sigin.css">

    </head>
    <body >

    <div class="gb_menu">
    <div align="center" img ><img src="/WebContent/WEB-INF/pics/logo.gif" width="292" height="65" alt="logo">

    </div>
    </div>
    </body>
    </html>

    This is signin.css file

    .gb_menu{
    background: #6633CC;
    font: Georgia, "Times New Roman", Times, serif;
    }

    There is no error, but it does not take sigin.css file or picure.

    I think there should be a effective way to reference external css or picture files in JSP page. I'm really a new comer. Any suggestion is welcome.

    PLEASE HELP.
    Last edited by han; Jul 7th, 2010, 12:42 AM. Reason: Typo

  • #2
    Hi

    First - try Spring Web forum
    Second - read Java Servlet spec - "WEB-INF" is by definition not accessible from outside (from browser) - move your web resources (css, js, images) above "WEB-INF"

    regards
    Grzegorz Grzybek

    Comment


    • #3
      Thank you. I moved those folder above WEB-INF, but it does not work.

      I will repost to Spring Web Forum.

      Thanks, again

      Comment


      • #4
        If you repost - I'll help you there

        Comment

        Working...
        X