Quick way to retrieve a service from a slingRequest
private <E> E getServiceFormRequest(
final SlingHttpServletRequest request, Class<E> serviceType ){
final SlingBindings bindings =
(SlingBindings) request.getAttribute(SlingBindings.class.getName());
SlingScriptHelper slingScriptHelper = bindings.getSling();
return slingScriptHelper.getService(serviceType);
}
private <E> E getServiceFormRequest(
final SlingHttpServletRequest request, Class<E> serviceType ){
final SlingBindings bindings =
(SlingBindings) request.getAttribute(SlingBindings.class.getName());
SlingScriptHelper slingScriptHelper = bindings.getSling();
return slingScriptHelper.getService(serviceType);
}
No hay comentarios:
Publicar un comentario