Stand alone的Spring示例 (IoC)

Reference:

1. 60秒入门教程: http://gabriel.jarchitect.org/spring/index.html

必需的jar文件包括: spring-core.jar, common-logging.jar, 在IDEA中,
运行Java虚拟机的目录并不是classes目录, 因此它在当前目录中无法找到
"bean.xml"文件, 使用下面的代码:

  import org.springframework.core.io.*;
  /* Read the configuration file from classpath */
   Resource res = new ClassPathResource("bean.xml");
   XmlBeanFactory factory = new XmlBeanFactory(res);


3 thoughts on “Stand alone的Spring示例 (IoC)

  1. 请问,mac下能推荐几个好的J2EE编辑环境软件么?我第一次尝试mac下编写简单的Java程序

  2. @Andy, 这个我也不是很在行,应该eclipse,netbeans,以及IntelliJ都支持Mac吧 ...

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

To submit your comment, click the image below where it asks you to...
Clickcha - The One-Click Captcha