* @return the product instance with the given product id
*/
public ProductWrapper findProductById(HttpServletRequest request, Long id) {
Product product = catalogService.findProductById(id);
if (product != null) {
ProductWrapper wrapper;
wrapper = (ProductWrapper) context.getBean(ProductWrapper.class.getName());
wrapper.wrapDetails(product, request);
return wrapper;
}
throw BroadleafWebServicesException.build(Response.Status.NOT_FOUND.getStatusCode())
.addMessage(BroadleafWebServicesException.PRODUCT_NOT_FOUND, id);
}