在SSH集成的前提下
之前我在網上找了好幾好久都沒有找到合適的方法
ApplicationContext context = new ClassPathXmlApplicationContext();
當時我覺得沒有這個必要
示例代碼
import org
import orgntext
import orgntext
public class MyApplicationContextUtil implements ApplicationContextAware {
private static ApplicationContext context;
//聲明一個靜態變量保存
public void setApplicationContext(ApplicationContext contex) throws BeansException {
ntext=contex;
}
public static ApplicationContext getContext(){
return context;
}
}
例
<!
<bean class=
From:http://tw.wingwit.com/Article/program/Java/ky/201311/28060.html