I'm trying to migrate code from Jax-Rs (jersey implementation) to a Spring MVC entry point:
jax-rs:
@GET
@Path("{bundle}/bundle{min: (-min)*}.{extension: js|css}")
public Response getBundle(@PathParam("bundle") String bundle, @PathParam("min") String min, @PathParam("extension") String extension)
Spring MVC:
@RequestMapping(method = GET, path = "{bundle}/bundle{min:(-min)?}{extension:\\.(js|css)?}")
public void getBundle(@PathVariable String bundle, @PathVariable String min, @PathVariable String extension)
According to Spring MVC documentation, i can use regex for @RequestMapping
. The syntax is similar to jaxrs but the entrypoint doesn't work (404 Not Found).
Example of value for the entrypoint: http://localhost:8080/foo/bundle-min.css
I've found a solution with @RequestMapping(method = GET, path = "{bundle}/bundle**")
but i have to parse the string to catch my needed parameter values.