Note that there are some explanatory texts on larger screens.

plurals
  1. POServlet mapping Issue wtih mvc resources spring
    primarykey
    data
    text
    <p>I have an issue with <code>mvc:resources</code></p> <p>My <code>main-servlet.xml</code></p> <pre><code> ** &lt;bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt; &lt;property name="prefix" value="/jsp/" /&gt; &lt;property name="suffix" value=".jsp" /&gt; &lt;/bean&gt; &lt;bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver"&gt; &lt;property name="maxUploadSize" value="50000000" /&gt; &lt;/bean&gt; &lt;mvc:resources mapping="/images/**" location="/images/" /&gt; &lt;mvc:resources mapping="/css/**" location="/css/" /&gt; ** </code></pre> <p>When I comment the <code>mvc:resources</code> lines everything (else) starts working magically. But when I uncomment the lines, ONLY the resources work. While compiling, log says that ONLY css/** and images/** were mapped and that there is no other mapping.</p> <p>Web.xml File : </p> <pre><code>&lt;servlet-mapping&gt; &lt;servlet-name&gt;main&lt;/servlet-name&gt; &lt;url-pattern&gt;/css/**&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; &lt;servlet-mapping&gt; &lt;servlet-name&gt;main&lt;/servlet-name&gt; &lt;url-pattern&gt;/images/**&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; &lt;servlet-mapping&gt; &lt;servlet-name&gt;main&lt;/servlet-name&gt; &lt;url-pattern&gt;/&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; </code></pre> <p>I tried putting 2 dispatcher servlets but that doesn't working either. The other servlet gets read and does get mapped but the request defaults to the main servlet.</p> <p>Compilation log AFTER commenting /css/** and /images/** from web.xml : </p> <pre><code> ** org.springframework.web.servlet.handler.AbstractUrlHandlerMapping registerHandler INFO: Mapped URL path [/images/**] onto handler 'org.springframework.web.servlet.resource.ResourceHttpRequestHandler#0' Nov 26, 2013 11:40:40 AM org.springframework.web.servlet.handler.AbstractUrlHandlerMapping registerHandler INFO: Mapped URL path [/css/**] onto handler 'org.springframework.web.servlet.resource.ResourceHttpRequestHandler#1' Nov 26, 2013 11:40:40 AM org.springframework.web.servlet.FrameworkServlet initServletBean INFO: FrameworkServlet 'resources': initialization completed in 220 ms Nov 26, 2013 11:40:40 AM org.apache.catalina.core.ApplicationContext log INFO: Initializing Spring FrameworkServlet 'main' Nov 26, 2013 11:40:40 AM org.springframework.web.servlet.FrameworkServlet initServletBean ** INFO: FrameworkServlet 'main': initialization completed in 234 ms Nov 26, 2013 11:40:40 AM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on http-8080 Nov 26, 2013 11:40:40 AM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-8080 Nov 26, 2013 11:40:53 AM org.springframework.web.servlet.DispatcherServlet noHandlerFound WARNING: No mapping found for HTTP request with URI [/KT/] in DispatcherServlet with name 'main' </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload