Spring REST always return 404
<p>I use spring mvc to create a rest web service. However, I always get 404. I don't have any idea where I go wrong. </p>

<p>Here is my Initializer:</p>

<pre><code>public class Initializer extends AbstractAnnotationConfigDispatcherServletInitializer {

@Override
protected Class&lt;?&gt;[] getRootConfigClasses() {
    // TODO Auto-generated method stub
    return new Class&lt;?&gt;[] { RootConfig.class };
}

@Override
protected Class&lt;?&gt;[] getServletConfigClasses() {
    // TODO Auto-generated method stub
    return new Class&lt;?&gt;[] { WebConfig.class };
}

@Override
protected String[] getServletMappings() {
    // TODO Auto-generated method stub
        return new String[] { "/" };
    }

}
</code></pre>

<p>Here is my Webconfig:</p>

<pre><code>@Configuration
@EnableWebMvc
@ComponentScan("com.jh.dummy.web")
public class WebConfig extends WebMvcConfigurerAdapter {
    @Bean
    public ViewResolver viewResolver() {
        InternalResourceViewResolver viewResovler = new InternalResourceViewResolver();
        viewResovler.setPrefix("/");
        viewResovler.setSuffix(".html");
        viewResovler.setExposeContextBeansAsAttributes(true);
        return viewResovler;
    }

    public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
        configurer.enable();
    }

}
</code></pre>

<p>Here is my rest server file:</p>

<pre><code>    @RestController
@RequestMapping("/v1/")
public class PositionService {
    @RequestMapping(value = "position", consumes = MediaType.APPLICATION_JSON_VALUE, method = POST)
    public void create(List&lt;Map&lt;String, String&gt;&gt; data) {
    }

    @RequestMapping(value = "position/{id:\\d+}", produces = MediaType.APPLICATION_JSON_VALUE, method = GET)
    public void getById(@PathVariable("id") Long id) {
    }

    @RequestMapping(value = "position/title/{title:.+}/{start:\\d{1,}}", produces = MediaType.APPLICATION_JSON_VALUE, method = GET)
    public void getByTitle(@PathVariable("title") String title,
            @PathVariable("start") int start) {
    }

@RequestMapping(value = "position/title/{title:.+}/address/{address:\\w{1,}}/{start:\\d{1,}}", produces = MediaType.APPLICATION_JSON_VALUE, method = GET)
public void getByTitleAndLocation(@PathVariable("title") String title,
        @PathVariable("address") String address, @PathVariable("start") int start) {

    }

    @RequestMapping(value = "position/address/{address:\\w{1,}}/{start:\\d{1,}}", produces = MediaType.APPLICATION_JSON_VALUE, method = GET)
    public void getByLocation(@PathVariable("address") String address,
            @PathVariable("start") int start) {
    }

    @RequestMapping(value = "position/company/{company:.{1,}}/{start:\\d{1,}}", produces = MediaType.APPLICATION_JSON_VALUE, method = GET)
    public void getByCompany(@PathVariable("company") String company,
                @PathVariable("start") int start) {
        }

    }
</code></pre>

<p>Here is the request:</p>

<p><a href="https://i.stack.imgur.com/APbo5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/APbo5.png" alt="enter image description here"></a></p>

<p>When I use curl test, I always get 404. I can't find where goes wrong. Any idea?</p>