String content = null;
// try and read from a file
String resource;
Resource resourceAnn = method.getAnnotation(Resource.class);
if (resourceAnn != null && !resourceAnn.value().equals("")) {
resource = resourceAnn.value();
} else {
resource = type.getName() + "#" + method.getName() + ".html";
}
resource = type.getPackage().getName().replace(".", "/") + "/" + resource;
InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(resource);