我想找出在ClassPathXmlApplicationContext
的構造函數中指定spring的XML文件的語法。通過語法我並不是指方法簽名,而是實際字符串用於在ClassPathXmlApplicationContext中指定spring xml文件的語法
例如以下三個工作。
ApplicationContext context = new ClassPathXmlApplicationContext("com/anshbansal/alarm/alarm.xml");
ApplicationContext context = new ClassPathXmlApplicationContext("classpath:alarm.xml");
ApplicationContext context = new ClassPathXmlApplicationContext("alarm.xml");
我已經google了,並試圖通過Spring 3.1.0
源代碼也通過。但是在org.springframework.core.env.AbstractPropertyResolver
類的春天doResolvePlaceholders
方法被卡住了。具體而言,我無法理解佔位符如何解決路徑問題。
任何人都可以分享什麼是字符串的語法來指定XML文件?
編輯
我指的是語法指定路徑的Spring XML文件中像在構造函數中。我不是指xml文件本身的語法。
我怕別人不回答你的問題,因爲這個問題不明確。你真正需要什麼 - 語法來指定spring xml文件的路徑,或者你正在尋找spring xml配置文件(它的內容)的語法,也就是這個http://docs.spring.io/spring-framework/docs /current/spring-framework-reference/html/xsd-config.html? – 2014-12-01 20:32:56
@MichalWilkowski更新問題後忘記了@你。 – 2014-12-09 16:50:28