2014-02-13 60 views

回答

4

你可以試試看:

import org.springframework.context.support.GenericXmlApplicationContext; 

String xmlDef = "..."; 
ApplicationContext ctx = new GenericXmlApplicationContext(new InputStreamResource(new ByteArrayInputStream(xmlDef.getBytes("UTF-8")))) 
+2

這讓我實際的解決方案,謝謝! 'new GenericXmlApplicationContext(new ByteArrayResource(xmlDef.getBytes(「UTF-8」)))' –

相關問題