title: Model.addAttribute does not work in my springmvc application
body: <p>I am new to Spring and am using Spring Tool Suite to run my application. I have configured my controller as displayed below and i am trying to print random quotes on my jsp. But the value does not get printed when i use <code>${randomQuote}</code> in my jsp.</p>
  
  <p>My Controller is</p>
  
  <pre><code>@Controller
  public class MyDemoController {
  
      String[] quotes={"To be or not to be - Shakespeare","Beauty lies in the eyes of the beholder",
              "With great power comes great responsibility"};
  
      @RequestMapping(value="/getQuote",method=RequestMethod.GET)
      public String getRandomQuote(Model model)
      {
  
          int randomNumber=new Random().nextInt(quotes.length);
          String randomQuote=quotes[randomNumber];
          model.addAttribute("randomQuote",randomQuote);
          return "quote";
      }
      }
  </code></pre>
  
  <p>My servletConfig is as follows</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:mvc="http://www.springframework.org/schema/mvc"
      xmlns:context="http://www.springframework.org/schema/context"
      xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd
          http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
          http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd"&gt;
  
      &lt;mvc:annotation-driven /&gt;
      &lt;context:component-scan base-package="com.kimble.controllers"&gt;&lt;/context:component-scan&gt;
  
      &lt;bean
          class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;
          &lt;property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/&gt;
          &lt;property name="prefix" value="/WEB-INF/jsp/" /&gt;
          &lt;property name="suffix" value=".jsp"&gt;&lt;/property&gt;
      &lt;/bean&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p>The contents of my web.xml are as follows:</p>
  
  <pre><code>&lt;!DOCTYPE web-app PUBLIC
   "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
   "http://java.sun.com/dtd/web-app_2_3.dtd" &gt;
  
  &lt;web-app&gt;
      &lt;display-name&gt;Demo App&lt;/display-name&gt;
  
      &lt;servlet&gt;
          &lt;servlet-name&gt;MyDemoApp&lt;/servlet-name&gt;
          &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
          &lt;init-param&gt;
              &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
              &lt;param-value&gt;/WEB-INF/config/myServletConfig.xml&lt;/param-value&gt;
          &lt;/init-param&gt;
      &lt;/servlet&gt;
  
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;MyDemoApp&lt;/servlet-name&gt;
          &lt;url-pattern&gt;*.html&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>URL that I hit : <a href="http://localhost:8080/Kimble/getQuote.html" rel="nofollow">http://localhost:8080/Kimble/getQuote.html</a> </p>
  
  <p>Any help will be deeply appreciated.</p>
  
  <p>Adding my jsp details</p>
  
  <pre><code>&lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1"
      pageEncoding="ISO-8859-1"%&gt;
  &lt;%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%&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;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&gt;
  &lt;title&gt;My Demo App&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
      &lt;h2&gt;The Quote is:&lt;/h2&gt;
      &lt;p&gt;${randomQuote}&lt;/p&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>