List of usage examples for org.springframework.core.convert ConversionFailedException printStackTrace
public void printStackTrace()
From source file:org.oncoblocks.centromere.web.controller.RequestUtils.java
/** * Converts an object into the appropriate type defined by the model field being queried. * * @param param// w w w . ja v a2 s. co m * @param type * @return */ public static Object convertParameter(Object param, Class<?> type, ConversionService conversionService) { logger.debug(String.format("Attempting to convert parameter: from=%s to=%s", param.getClass().getName(), type.getName())); if (conversionService.canConvert(param.getClass(), type)) { try { return conversionService.convert(param, type); } catch (ConversionFailedException e) { e.printStackTrace(); throw new InvalidParameterException("Unable to convert String to " + type.getName()); } } else { return param; } }