此规则会检测是否使用了 WebLogic setAttribute 和 getAttribute 属性来解析 XML。 此规则会检测 Java 代码。 另一规则会检测是否使用了 WebLogic weblogic.servlet.XMLParsingHelper(用来启用此功能部件)。
例如:
request.setAttribute("org.xml.sax.helpers.DefaultHandler", someObject)
例如:
String handler = "org.xml.sax.helpers.DefaultHandler";
request.setAttribute(handler, someObject);
例如:Document myDocument = request.getAttribute("org.w3c.dom.Document")
例如:
String handler = "org.w3c.dom.Document";
Document myDoc = request.getAttribute(handler);
例如:
request.setAttribute("org.xml.sax.helpers.DefaultHandler", myHandler);
request.getAttribute("org.w3c.dom.Document");
当快速修订应用于前面的行时,那些行会被删除。
注意:如果后面在代码内使用了对象 myHandler,请验证是否已通过其他方式初始化该对象。
例如:
Document myDocument = request.getAttribute("org.w3c.dom.Document");
当应用了快速修订时,前面的代码会被更改为:
Document myDocument;
注意:如果后面在代码内使用了对象
myDocument,请验证是否已通过其他方式初始化该对象。