我正在尝试创建一个FEATURE_SECURE_PROCESSING
设置为DocumentBuilderFactory 的实例true
。当我尝试 setFeature 时,我不断收到 ParserConfigurationException。
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
try{
factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
}
catch (ParserConfigurationException e){ //Always gets here
e.printStackTrace();
}