title: spring 3 , tiles can not display image or use css style
body: <p>I have deleloped a simple spring 3 application following a tutorial. After that, I did integrated tiles 2. Right now I am trying to use css style in my tiles but i can not do this and i can not even display an image. </p>
  
  <p>Inside my tiles.xml I have:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
  &lt;!DOCTYPE tiles-definitions PUBLIC
     "-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
     "http://tiles.apache.org/dtds/tiles-config_2_0.dtd"&gt;
  &lt;tiles-definitions&gt;
  &lt;definition name="base.definition"
      template="/WEB-INF/jsp/layout.jsp"&gt;
      &lt;put-attribute name="title" value="" /&gt;
      &lt;put-attribute name="header" value="/WEB-INF/jsp/header.jsp" /&gt;
      &lt;put-attribute name="menu" value="/WEB-INF/jsp/menu.jsp" /&gt;
      &lt;put-attribute name="body" value="" /&gt;
      &lt;put-attribute name="styles" value="base.css"/&gt;
      &lt;put-attribute name="footer" value="/WEB-INF/jsp/footer.jsp" /&gt;
  &lt;/definition&gt;
  
  &lt;definition name="dogBreed" extends="base.definition"&gt;
      &lt;put-attribute name="title" value="Contact Manager" /&gt;
      &lt;put-attribute name="body" value="/WEB-INF/jsp/dogBreed.jsp" /&gt;
  &lt;/definition&gt;
  
  &lt;/tiles-definitions&gt;
  </code></pre>
  
  <p>Inside layout.jsp I have</p>
  
  <pre><code>&lt;%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%&gt;
  &lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;html&gt;
  &lt;link type="text/css" rel="stylesheet" href="&lt;%=request.getContextPath()%&gt;/styles/style.css"/&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
  &lt;title&gt;&lt;tiles:insertAttribute name="title" ignore="true" /&gt;&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;table border="1" cellspacing="0" cellpadding="0" style="width:100%;height:100%"&gt;
      &lt;tr&gt;
          &lt;td height=10% width=100%&gt;&lt;tiles:insertAttribute name="header" /&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td height=80% width=20%&gt;&lt;tiles:insertAttribute name="menu" /&gt;&lt;/td&gt;
          &lt;td width=80%  height=80%&gt;&lt;tiles:insertAttribute name="body" /&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td height=10% width=100%&gt;&lt;tiles:insertAttribute name="footer" /&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>What I want is to remove the table structure and use css. For this I use on layout.jsp the following:</p>
  
  <pre><code>&lt;link type="text/css" rel="stylesheet" href="&lt;%=request.getContextPath()%&gt;/style style.css"/&gt;
  </code></pre>
  
  <p>Now inside my header.jsp I have:</p>
  
  <pre><code>&lt;div id="header"&gt;
  
     &lt;div class="top_right"&gt;
  
          &lt;div class="languages"&gt;
              &lt;div class="lang_text"&gt;Languages:&lt;/div&gt;
              &lt;a href="#" class="lang"&gt;&lt;img src="&lt;%=request.getContextPath()%&gt;/styles/images/en.gif" alt="" title="" border="0" /&gt;&lt;/a&gt;
              &lt;a href="#" class="lang"&gt;&lt;img src="styles/images/de.gif" alt="" title="" border="0" /&gt;&lt;/a&gt;       
          &lt;/div&gt;
  
          &lt;div class="big_banner"&gt;
          &lt;a href="#"&gt;&lt;img src="images/banner728.jpg" alt="" title="" border="0" /&gt;&lt;/a&gt;
          &lt;/div&gt;
  
      &lt;/div&gt;
  
  
      &lt;div id="logo"&gt;
          &lt;a href="index.html"&gt;&lt;img src="images/logo.png" alt="" title="" border="0" width="182" height="85" /&gt;&lt;/a&gt;
      &lt;/div&gt;
     &lt;/div&gt;
  </code></pre>
  
  <p>None of the imaeges are getting displayed here and i do not understand why. </p>
  
  <p>The folder styles which cotnrains css and images is in the rood folder of the war. </p>
  
  <p>Also I get an error in my console saying that "no mapping found for HTTP request with uri /pedsample/styles/images/en.gif in dispatcher servlet with name spring"</p>
  
  <p>My web.xml contains the following if od any help:</p>
  
  <pre><code>&lt;servlet&gt;
      &lt;servlet-name&gt;spring&lt;/servlet-name&gt;
      &lt;servlet-class&gt;
          org.springframework.web.servlet.DispatcherServlet
      &lt;/servlet-class&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;spring&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>Any help would be appreciated.</p>
  
  <p>Thanks a lot,
  giannis</p>