title: Unable to invoke Spring MVC Controller
body: <p>I have tried a lot with multiple ways but could not invoke Spring Controller from my jsp page. Even simple string renderring is not working. So here is the background - </p>
  
  <p>I am running on Tomcat 9.0 M22 with Spring 4.3.9</p>
  
  <p>My test.jsp page is containing $greeting in the body part value of which i can render it Controller.</p>
  
  <p>****web.xml file****</p>
  
  <pre><code>    &lt;context-param&gt;
          &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
          &lt;param-value&gt;/WEB-INF/config/test-servlet.xml&lt;/param-value&gt;
      &lt;/context-param&gt;
  
      &lt;servlet&gt;
          &lt;servlet-name&gt;test&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;&lt;/param-value&gt;
          &lt;/init-param&gt;
          &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
  
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;test&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/test/*&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
      &lt;listener&gt;
          &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
      &lt;/listener&gt;
  
  
    &lt;welcome-file-list&gt;
      &lt;welcome-file&gt;index.html&lt;/welcome-file&gt;
     &lt;/welcome-fil`enter code here`e-list&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p><strong>test-servlet.xml file</strong></p>
  
  <p></p>
  
  <p></p>
  
  <pre><code>&lt;bean id = "viewResolver" 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 = "/jsp/"/&gt; 
  &lt;property name="suffix" value=".jsp"/&gt;
  </code></pre>
  
  <p></p>
  
  <p></p>
  
  <p>****Controller File****</p>
  
  <pre><code>@Controller
  public class HelloMarsTeamController {
  
      @RequestMapping(value = "/test")
      public String sayHello(Model model) {
          model.addAttribute("greeting", "Hello world");
  
          return "hello";
      }
  }
  </code></pre>
  
  <p>When i invoke the URL <a href="http://localhost:8080/marsapp/jsp/test.jsp" rel="nofollow noreferrer">http://localhost:8080/marsapp/jsp/test.jsp</a>, it just luanch an empty screen with title "Test". So it seems that jsp is called but the logic of controller is not invoked.</p>
  
  <p>Unable to figure what is incorrect. </p>
  
  <p>Thanks for your help in advance.. </p>