title: Can't load view.jsp using Spring MVC
body: <p>I'm new in Spring MVC and try to make an exercise, like in the example. I have index.jsp and view.jsp. Index.jsp is loaded well, but when I try load view.jsp, it teturns empty field and logger doesnt show me any mistake. I use IntellijIDEA. Below all classes and files, let me know, if i have to give other info. Thanks.</p>
  
  <p>web.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee 
    http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
       version="3.1"&gt;
  
  &lt;context-param&gt;
      &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
      &lt;param-value&gt;/WEB-INF/dispatcher-servlet.xml&lt;/param-value&gt;
  &lt;/context-param&gt;
  
  &lt;listener&gt;
      &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
  &lt;/listener&gt;
  
  &lt;servlet&gt;
      &lt;servlet-name&gt;dispatcher&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;dispatcher&lt;/servlet-name&gt;
      &lt;url-pattern&gt;*.form&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p></p>
  
  <p>dispatcher-servlet.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns:context="http://www.springframework.org/schema/context"
     xmlns:mvc="http://www.springframework.org/schema/mvc"
     xsi:schemaLocation="http://www.springframework.org/schema/beans       
  http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
     http://www.springframework.org/schema/context  
  http://www.springframework.org/schema/context/spring-context-3.1.xsd
     http://www.springframework.org/schema/mvc 
  http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd
     "&gt;
  
  &lt;context:component-scan base-package="controllers"/&gt;
  
  &lt;bean id="vievResolver" class ="org.springframework.web.servlet.view.UrlBasedViewResolver"&gt;
      &lt;property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/&gt;
      &lt;property name="prefix" value="/WEB-INF/"/&gt;
      &lt;property name="suffix" value=".jsp"/&gt;
  &lt;/bean&gt;
  
  &lt;bean id="HttpGatewayInit" class ="controllers.HttpGatewayInit"&gt;
  &lt;/bean&gt;
  
  &lt;bean name="shape" class="shapes.Rectangle"&gt;
      &lt;constructor-arg index="0" value ="12" /&gt;
      &lt;constructor-arg index="1" value ="2" /&gt;
  &lt;/bean&gt;
  
  &lt;bean name="circle" class="shapes.Circle"&gt;
      &lt;constructor-arg index="0" value ="8" /&gt;
  &lt;/bean&gt;
  
  &lt;bean name="rectanglepoint" class="shapes.RectanglePoint"&gt;
      &lt;constructor-arg index="0" ref ="leftend" /&gt;
      &lt;constructor-arg index="1" ref ="rightend" /&gt;
  &lt;/bean&gt;
  
  &lt;bean name="leftend" class="shapes.Point"&gt;
      &lt;constructor-arg index="0" value ="4" /&gt;
      &lt;constructor-arg index="1" value ="3" /&gt;
  &lt;/bean&gt;
  
  &lt;bean name="rightend" class="shapes.Point"&gt;
      &lt;property name="x" value ="12" /&gt;
      &lt;property name="y" value ="8" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p></p>
  
  <p>Controller (System.out.println(shape.square()) shows me, that mapping do work)</p>
  
  <pre><code>package controllers;
  
  import org.springframework.asm.Attribute;
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.beans.factory.annotation.Qualifier;
  import org.springframework.stereotype.Controller;
  import org.springframework.web.WebApplicationInitializer;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.bind.annotation.RequestMethod;
  import org.springframework.web.portlet.ModelAndView;
  import shapes.Shape;
  
  import javax.servlet.ServletContext;
  import javax.servlet.ServletException;
  
  
  @Controller
  public class MainController {
  
  @Autowired
  @Qualifier("shape")
  private Shape shape;
  
  public MainController(){
  }
  
  @RequestMapping (value="/shape.form",method = RequestMethod.GET)
  public ModelAndView main(){
      /*class HttpGatewayInit implements WebApplicationInitializer {
          @Override
          public void onStartup(ServletContext servletContext) throws ServletException {
  
          }
      }*/
  
      ModelAndView modelAndView = new ModelAndView();
      modelAndView.setViewName("view");
      modelAndView.addObject("message", shape.square());
      System.out.println(shape.square());
  
  
      return modelAndView;
  
  }
  }
  </code></pre>
  
  <p>index.jsp</p>
  
  <pre><code>&lt;%@ page contentType="text/html;charset=UTF-8" language="java" %&gt;
  &lt;html&gt;
   &lt;head&gt;
    &lt;title&gt;$Title$&lt;/title&gt;
   &lt;/head&gt;
   &lt;body&gt;
    &lt;a href = "shape.form"&gt;Next page&lt;/a&gt;
   &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>view.jsp</p>
  
  <pre><code>&lt;%@ page contentType="text/html;charset=UTF-8" language="java" %&gt;
  &lt;html&gt;
   &lt;head&gt;
    &lt;title&gt;View&lt;/title&gt;
   &lt;/head&gt;
   &lt;body&gt;
    &lt;span&gt;${message}&lt;/span&gt;
   &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>