Note that there are some explanatory texts on larger screens.

plurals
  1. POSpring MVC - No mapping found for HTTP request with URI
    primarykey
    data
    text
    <p>I'm aware that there are loads of questions on the topic but none of the solutions i found here worked for me. I'm using Spring with Jetty 6 so i don't have a web.xml file. The mapping for the spring dispatcher servlet is set to "/" in jetty's config</p> <p>dispatcher:</p> <pre><code>&lt;bean class="org.mortbay.jetty.servlet.ServletHolder"&gt; &lt;property name="name" value="spring" /&gt; &lt;property name="servlet"&gt; &lt;bean class="org.springframework.web.servlet.DispatcherServlet" /&gt; &lt;/property&gt; &lt;property name="initParameters"&gt; &lt;map&gt; &lt;entry key="contextConfigLocation" value="classpath:com/project/config/spring-servlet.xml" /&gt; &lt;/map&gt; &lt;/property&gt; &lt;/bean&gt; </code></pre> <p>... mapping:</p> <pre><code>&lt;bean class="org.mortbay.jetty.servlet.ServletMapping"&gt; &lt;property name="servletName" value="spring"&gt;&lt;/property&gt; &lt;property name="pathSpec" value="/"&gt;&lt;/property&gt; &lt;/bean&gt; </code></pre> <p>The spring-servlet.xml looks like this:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;beans xmlns="..." ...&gt; &lt;context:component-scan base-package="com.project.web" /&gt; &lt;mvc:annotation-driven /&gt; &lt;bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt; &lt;property name="prefix"&gt; &lt;value&gt;/WEB-INF/pages/&lt;/value&gt; &lt;/property&gt; &lt;property name="suffix"&gt; &lt;value&gt;.jsp&lt;/value&gt; &lt;/property&gt; &lt;/bean&gt; &lt;/beans&gt; </code></pre> <p>And i have a simple controller called HelloController:</p> <pre><code>@Controller public class HelloController { @RequestMapping(method = RequestMethod.GET, value="/welcome") public String sayHello(ModelMap model){ model.addAttribute("message", "Spring 3 MVC Hello World"); return "hello"; } </code></pre> <p>}</p> <p>Reading the logs it seem to work but i get the following error: </p> <p>No mapping found for HTTP request with URI [/WEB-INF/pages/hello.jsp] in DispatcherServlet with name 'spring'</p> <p>which i don't understand. it maps the "/welcome" to /WEB-INF/pages/hello.jsp but it still says page cannot be found, which is just there where it seems to look for it. I added the WEB-INF folder to the classpath but it's still the same. Do you have any idea why's that?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    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