官方网站直接下载到的压缩包包含了api文档、示例、源代码、测试代码、依赖的各种项目的包,你不可以把它直接加入你的工程中的。
打开它,里边一半会有一个dist目录,其中会有一些扩展名为.jar的包,如spring.jar/spring-mvc.jar/spring-dao.jar等等,它们各自有不同的作用,根据你的项目对spring的功能要求,将对应的包加进去。

解决方案 »

  1.   

    谢谢楼上的!!!
    我想问一下spring-framework-1.2.7\dist里面的各个包都有什么用呢?
    好像找不到相关的说明
    我看到别人的lib中只要了spring.jar和spring-mock.jar。
    请指点,谢谢。
      

  2.   

    * "spring-core" (~120 KB)
    - Contents: core utilities
    - Dependencies: Commons Logging, (Log4J)* "spring-beans" (~225 KB)
    - Contents: JavaBeans support, bean container
    - Dependencies: spring-core, (CGLIB)* "spring-aop" (~155 KB)
    - Contents: AOP framework, source-level metadata support, AOP Alliance interfaces
    - Dependencies: spring-core, (spring-beans, CGLIB, Commons Attributes)* "spring-context" (~105 KB)
    - Contents: application context, validation, JNDI, UI context support
    - Dependencies: spring-beans, (spring-aop, Velocity, FreeMarker, JasperReports)* "spring-dao" (~95 KB)
    - Contents: DAO support, transaction infrastructure
    - Dependencies: spring-core, (spring-beans, spring-aop, spring-context, JTA)* "spring-jdbc" (~185 KB)
    - Contents: JDBC support
    - Dependencies: spring-dao, spring-beans* "spring-support" (~165 KB)
    - Contents: JMX support, JCA support, scheduling support, mail support, caching support
    - Dependencies: spring-beans, (spring-dao, spring-context, spring-jdbc, JMX, Quartz, JavaMail, EHCache)* "spring-web" (~140 KB)
    - Contents: web application context, multipart resolver, Struts support, JSF support, web utilities
    - Dependencies: spring-context, Servlet, (JSP, JSTL, Commons FileUpload, COS, Struts, JSF)* "spring-webmvc" (~205 KB)
    - Contents: framework servlets, web MVC framework, web controllers, web views
    - Dependencies: spring-web, (Tiles, iText, POI, Velocity, FreeMarker, JasperReports)* "spring-remoting" (~140 KB)
    - Contents: remoting support, EJB support, JMS support
    - Dependencies: spring-aop, spring-beans, (spring-context, spring-web, Hessian, Burlap, JAX-RPC, EJB, JMS)* "spring-orm" (~180 KB)
    - Contents: iBATIS SQL Maps support, Apache OJB support, TopLink support, JDO support
    - Dependencies: spring-dao, spring-beans, (spring-aop, spring-web, iBATIS SQL Maps, Apache OJB, TopLink, JDO)* "spring-hibernate" (~190 KB)
    - Contents: Hibernate 2.1 support, Hibernate 3.x support
    - Dependencies: spring-dao, spring-beans, (spring-aop, spring-web, Hibernate2, Hibernate3)* "spring" (~1885 KB)
    - Contents: all of the above (note: mocks not included)
    - Dependencies: all of the above* "spring-mock" (~45 KB)
    - Contents: JNDI mocks, Servlet API mocks, JUnit support
    - Dependencies: spring-core