title: Spring URL not changing
body: <p>I am new to spring.</p>
  
  <p>In the index page, I have a jsp code like this:</p>
  
  <pre class="lang-jsp prettyprint-override"><code>&lt;a href="ja4s"&gt;&lt;br&gt; Click here to check the output :-)&lt;/a&gt;
  </code></pre>
  
  <p>In the Controller, I have the following code:</p>
  
  <pre class="lang-java prettyprint-override"><code>@RequestMapping("/ja4s")
  public ModelAndView helloWorld() {
      String msg =  "Welcome to Java4s.com Spring MVC 3.2.x                                          Sessions";
  
      msg += "&lt;br&gt;You Did it....!";
  
      return new ModelAndView("welcomePage", "welcomeMessage", msg);
  }
  </code></pre>
  
  <p>In the <code>web.xml</code>, I have a URL pattern like this:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;url-pattern&gt;/&lt;/url-pattern&gt;
  </code></pre>
  
  <p>and when I try to run the project it is showing me an url like this</p>
  
  <pre class="lang-none prettyprint-override"><code>http://localhost:8080/SpringMvcHelloWorldProgram/
  </code></pre>
  
  <p>and when I click on the Link it is directing me to other page and shows a URL like this:</p>
  
  <pre class="lang-none prettyprint-override"><code>http://localhost:8080/SpringMvcHelloWorldProgram/ja4s
  </code></pre>
  
  <hr>
  
  <ol>
  <li>Now my doubt is when we are returning a model and view object in the controller
  we are getting getting redirected to <strong>welcomepage</strong> which is given by the model and view object in the controller.</li>
  </ol>
  
  <p>but as my my understanding it should be like this </p>
  
  <pre><code>http://localhost:8080/SpringMvcHelloWorldProgram/welcomepage.
  </code></pre>
  
  <p>Instead it is showing me an URL like this</p>
  
  <pre><code> http://localhost:8080/SpringMvcHelloWorldProgram/ja4s
  </code></pre>
  
  <ol start="2">
  <li>When I change the url pattern in the <code>web.xml</code> like this </li>
  </ol>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;url-pattern&gt;*.jsp&lt;/url-pattern&gt; &lt;!-- It is giving me an error. --&gt;
  </code></pre>
  
  <p>As per my understanding in the above URL pattern it should accept only pages ending with jsp (which I am providing), but am getting an error saying that the requested resource is not found in the server.</p>
  
  <p>Can anyone help me with above two doubts? :)</p>