It's quite similar to this question, but I just couldn't figure out how to match the url pattern.
web.xml:
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>/activate/*</url-pattern>
</servlet-mapping>
My controller:
@RequestMapping(value = {"activate/{key}"}, method = RequestMethod.GET)
public ModelAndView activate(@PathVariable(value = "key") String key) {
...
}
When I try to access localhost:9999/myApp/activate/123456789, I get the following error:
No mapping found for HTTP request with URI [/myApp/activate/123456789] in DispatcherServlet with name 'dispatcher'
I also tried <url-pattern>/*</url-pattern>, same thing happens.
However, by changing <url-pattern>/activate/*</url-pattern> to
<url-pattern>/**</url-pattern> no error appears, but i still get 404.
So, how do I map this url pattern?