@Controller
@RequestMapping("/authors")
public class AuthorController {
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
public Author getAuthor(
final HttpServletRequest request,
final HttpServletResponse response,
@PathVariable final String id)
{
return null;
}
@RequestMapping(value = "/{id}/author-properties", method = RequestMethod.GET)
public AuthorProperties getAuthorProperties(
final HttpServletRequest request,
final HttpServletResponse response,
@PathVariable final String id)
{
return null;
}
@RequestMapping
public List<AuthorProperties> listAuthorProperties(
final HttpServletRequest request,
final HttpServletResponse response)
{
return null;
}
}
class Author {
String propertiesUri;
}
class AuthorProperties {
String authorUri;
}
Basically I need:
- / authors - listing all authors
- / authors / 123 - select author by id 123
- / authors / 123 / author-properties - select the AuthorProperties object for the author 123
- / authors / * / author-properties - selection of the AuthorProperties list for all authors
When i tried
@RequestMapping(value = "/*/author-properties", method = RequestMethod.GET)
It still matched the /authors/*/author-propertiesgetAuthorProperties method with the path variable value as "*".
Litty source
share