package com.openv.spring;import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
public class HelloClient {
protected static final Log log = LogFactory.getLog(HelloClient.class); public static void main(String[] args) {
Resource resource = new ClassPathResource("appcontext.xml");
BeanFactory factory = new XmlBeanFactory(resource);
IHelloWorld hw = (IHelloWorld) factory.getBean("helloworldbean");
log.info(hw.getContent("luoshifei"));
}
}
编译的时候提示包没有,但是我已经导入了啊
你在错误显示没有导入的类上按ctrl+shift+O试试~