New to spring and have a question regarding setting the Rest URI path.
I have a working rest service and I would like to change the URI from something like http://localhost:8080/myapp/api
to http://localhost:8080/api
Normally I would do this with an annotation such as: @ApplicationPath("api") but that doesnt seem to be applicable, tried the below but doesnt give the desired result.
TestController.java
@Controller
@RequestMapping("api")
public class TestController {
@RequestMapping("/test")
public @ResponseBody Test Test() {
return new Test("Test String");
}
}
How can this be done with spring?