public class ResourceParamArgumentResolver extends Object implements org.springframework.web.method.support.HandlerMethodArgumentResolver
ResourceModel
arguments of a
RequestMapping
.
@This will expect a String parameter "model", which is a path to a JCR resource adapting to "MyModel". This argument resolver will resolve the path and adapt to the desired model. Unless the resource param is notRequestMapping
(...) public void myHandlerMethod(@ResourceParam
MyModel model, ...) { ... }
required
, an exception will be thrown
if the parameter is missing, the path is unresolvable or the resource cannot be adapted to the desired model,
i.e. the resulting model instance is guaranteed not to be null
.Constructor and Description |
---|
ResourceParamArgumentResolver() |
Modifier and Type | Method and Description |
---|---|
Object |
resolveArgument(org.springframework.core.MethodParameter parameter,
org.springframework.web.method.support.ModelAndViewContainer container,
org.springframework.web.context.request.NativeWebRequest webRequest,
org.springframework.web.bind.support.WebDataBinderFactory binderFactory) |
boolean |
supportsParameter(org.springframework.core.MethodParameter parameter) |
public boolean supportsParameter(org.springframework.core.MethodParameter parameter)
supportsParameter
in interface org.springframework.web.method.support.HandlerMethodArgumentResolver
public Object resolveArgument(org.springframework.core.MethodParameter parameter, org.springframework.web.method.support.ModelAndViewContainer container, org.springframework.web.context.request.NativeWebRequest webRequest, org.springframework.web.bind.support.WebDataBinderFactory binderFactory) throws Exception
resolveArgument
in interface org.springframework.web.method.support.HandlerMethodArgumentResolver
Exception
Copyright © 2024. All rights reserved.