@Test public void readXmlRootElementExternalEntityEnabled() throws Exception { Resource external = new ClassPathResource("external.txt", getClass()); String content = "<!DOCTYPE root [" + " <!ELEMENT external ANY >\n" + " <!ENTITY ext SYSTEM \"" + external.getURI() + "\" >]>" + " <rootElement><external>&ext;</external></rootElement>"; MockHttpInputMessage inputMessage = new MockHttpInputMessage(content.getBytes("UTF-8")); this.converter.setProcessExternalEntities(true); RootElement rootElement = (RootElement) converter.read(RootElement.class, inputMessage); assertEquals("Foo Bar", rootElement.external); }
public void setProcessExternalEntities(boolean processExternalEntities) { this.processExternalEntities = processExternalEntities; }
Jaxb2RootElementHttpMessageConverter extends AbstractJaxb2HttpMessageConverter<Object> { public void setProcessExternalEntities(boolean processExternalEntities) { this.processExternalEntities = processExternalEntities; } }
Jaxb2RootElementHttpMessageConverter extends AbstractJaxb2HttpMessageConverter<Object> { public void setProcessExternalEntities(boolean processExternalEntities) { this.processExternalEntities = processExternalEntities; }  }
Jaxb2RootElementHttpMessageConverter extends AbstractJaxb2HttpMessageConverter<Object> { public void setProcessExternalEntities(boolean processExternalEntities) { this.processExternalEntities = processExternalEntities; }  void setProcessExternalEntities(boolean processExternalEntities); boolean isProcessExternalEntities(); @Override boolean canRead(Class<?> clazz, MediaType mediaType); @Override boolean canWrite(Class<?> clazz, MediaType mediaType); }
Jaxb2RootElementHttpMessageConverter extends AbstractJaxb2HttpMessageConverter<Object> { public void setProcessExternalEntities(boolean processExternalEntities) { this.processExternalEntities = processExternalEntities; }  void setProcessExternalEntities(boolean processExternalEntities); boolean isProcessExternalEntities(); @Override boolean canRead(Class<?> clazz, MediaType mediaType); @Override boolean canWrite(Class<?> clazz, MediaType mediaType);  }