List<Element> els = source.getAllElements();
for (Element el : els) {
if (el.getName().equals(settings.getTagName())) {
try {
String body = el.getContentAsString();
Attributes attrs = source.parseAttributes(el);
String id = attrs.getValue("id");
String method = attrs.getValue("method");
String options = attrs.getValue("options");
String basepath = attrs.getValue("basepath");
if (body == null) body = "";
if (body.contains("<%--"))
body = removeJspComments(body);
if (body.contains("<%")) {
logger.warn("Dynamic content found, tag skipped in file " + filename);
} else {
CompressTagHandler tagHandler = new CompressTagHandler(id, method, options, basepath);
tagHandler.handleTag(request, null, body);
}
} catch (JSCompileException e) {
errorCount++;
logger.error("Tag process exception:", e);
}
} else if (el.getName().equals("%")) {
Attributes attrs = source.parseAttributes(el);
if (attrs != null && attrs.isValueExists("include") && attrs.isValueExists("file")) {
String file = attrs.getValue("file");
String pa = "";
if (!file.trim().startsWith("/") && file.indexOf("/")>=0)
pa = file.substring(0, file.lastIndexOf("/")+1);
file = webAppRootPath + "/" + PathUtils.calcPath(
(pathAddition.equals("")||file.startsWith("/")?"":(pathAddition+"/"))+file, request,"");