你看能不能先取到服务器地址加文件名看看
把
File file = new File("E:/temp/ccctc.application");
这句话改下
public static final String PROPERTIES_FILE_NAME = "/ccctc.application";
path = this.getClass().getResource("").getPath();
int pos = path.indexOf("WEB-INF");
path = path.substring(0, pos)+"WEB-INF\\classes";
file = new File(path, PROPERTIES_FILE_NAME);
把文件放到web-inf/classes 的目录下面我想应该不会在出现这样的问题了
把
File file = new File("E:/temp/ccctc.application");
这句话改下
public static final String PROPERTIES_FILE_NAME = "/ccctc.application";
path = this.getClass().getResource("").getPath();
int pos = path.indexOf("WEB-INF");
path = path.substring(0, pos)+"WEB-INF\\classes";
file = new File(path, PROPERTIES_FILE_NAME);
把文件放到web-inf/classes 的目录下面我想应该不会在出现这样的问题了
* @see org.xml.sax.EntityResolver#resolveEntity(java.lang.String, java.lang.String)
*/
public InputSource resolveEntity(String publicId, String systemId)
throws SAXException, IOException {
return new InputSource(new StringBufferInputStream(""));
}}然后reader.setEntityResolver(new NoopEntityResolver());即可。