title: Spring MVC : URL Pattern
body: <p>here is my web.xml</p>
  
  <pre><code>&lt;servlet&gt;
        &lt;servlet-name&gt;Learn&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;Learn&lt;/servlet-name&gt;
        &lt;url-pattern&gt;/learn/*&lt;/url-pattern&gt;
     &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>if i change this code</p>
  
  <pre><code>&lt;url-pattern&gt;/learn/*&lt;/url-pattern&gt;
  </code></pre>
  
  <p>to </p>
  
  <pre><code>&lt;url-pattern&gt;/learn/abc/&lt;/url-pattern&gt;
  </code></pre>
  
  <p>i can hit my controller code which is given as</p>
  
  <pre><code>@Controller
  @RequestMapping(value = "/learn")
  public class ControllerClass
  {
      @RequestMapping(value = "/", method = RequestMethod.GET)
      public String callRequest(ModelMap model)
      {
          return "index";
      }
  
      @RequestMapping(value = "/abc/", method = RequestMethod.GET)
      public String personController(ModelMap model)
      {
          return "welcome";
      }
  }
  </code></pre>
  
  <p>but i also want to hit the first method or i will add more method, which i can not achieve by </p>
  
  <pre><code>/learn/abc/
  </code></pre>
  
  <p>in url mapping.</p>
  
  <p>so please help me out with this</p>
  
  <p>pom.xml</p>
  
  <pre><code>&lt;dependencies&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
              &lt;artifactId&gt;servlet-api&lt;/artifactId&gt;
              &lt;version&gt;2.5&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;version&gt;3.8.1&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;!-- spring-context which provides core functionality --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-context&lt;/artifactId&gt;
              &lt;version&gt;4.1.6.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- The spring-aop module provides an AOP Alliance-compliant aspect-oriented 
              programming implementation allowing you to define --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-aop&lt;/artifactId&gt;
              &lt;version&gt;4.1.6.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- The spring-webmvc module (also known as the Web-Servlet module) contains 
              Spring’s model-view-controller (MVC) and REST Web Services implementation 
              for web applications --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-webmvc&lt;/artifactId&gt;
              &lt;version&gt;4.1.6.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- The spring-web module provides basic web-oriented integration features 
              such as multipart file upload functionality and the initialization of the 
              IoC container using Servlet listeners and a web-oriented application context --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-web&lt;/artifactId&gt;
              &lt;version&gt;4.1.6.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  </code></pre>
  
  <p>please let me know if i missed any dependency</p>