String path = annot.getValue("value").getString();
String packageName = className.substring(0, className.lastIndexOf('.'));
String resourceName = packageName.replace('.', '/') + "/" + path;
try (InputStream input = context.getClassLoader().getResourceAsStream(resourceName)) {
if (input == null) {
throw new RenderingException("Error processing JavaScriptResource annotation on class " +
className + ". Resource not found: " + resourceName);
}
@SuppressWarnings("resource")
StringWriter writer = new StringWriter();
IOUtils.copy(input, writer);