在eclipse中如何配置spring

java新手 最近准备学习Spring 但是eclipse中配置spring的过程不是太清楚。。。请高手给以详细的指导(最好附图),感激!!!

[url]http://dev.yesky.com/118/2527618.shtml[/url]

看看这个springide,一个eclipse插件

直接下载myeclipse用比较方便,要开发java ee也可以用eclipse的java ee版本

Spring不用配置的吧!他就是一些jar包,拿来用就可以了!因为spring配置文件是xml,所以你可以下一个SpringIDE帮助你编辑就可以了!在它的官方网站有很详细的使用文档.

用myeclipse,也有专门的对eclipse的spring插件 不过你可以在论坛搜索一下,有人配置好的,你直接下载来用就ok了

有spring jar 包和eclipse 就可以了。

用myeclipse 5.5 可以自动配的,加我的msn:winner_j2ee@sina.com 我发给你

你可以这样开始
1、开始使用Myeclipse应为如果要研究spring基本上是用于jee开发的居多,Myeclipse已经为带有了很多常用的插件,开发起来非常便利。
2、使用Myeclipse建立项目,有两个方法可以建立项目
1.file---new---web project 输入项目名,完成
2.在左边package Explorer空白处,右击---new---web project同上建立成功
3、右击项目名---properties---java build path---Libraries 点右边的 "Add Library",在跳出的窗口中选择 “MyEclipse Libraries”,然后 把spring 2.5的都勾上。

以上项目spring jar包安装完毕,如果想深入了解spring 建意去看 满江红的Spring Framework 2.5 Reference中文版(也是一份非常好的学习材料哦。)
http://wiki.redsaga.com/confluence/display/Spring2/Spring2.5

然后是配置文件:
1 打开项目的WebRoot--WEB-INF 下打开web.xml

[code="java"]<?xml version="1.0" encoding="UTF-8"?>
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

contextConfigLocation

/WEB-INF/config/localContext.xml //这里引入了spring的配置文件,你可以引如过个

<listener>
    <listener-class>    org.springframework.web.context.ContextLoaderListener
    </listener-class>
</listener>


index.jsp

[/code]

2 就是配置你的spring 文件内容 /WEB-INF/config/localContext.xml (自己在web-inf 下建立一个config文件夹,然后建localContext.xml)

[code="java"]<?xml version="1.0" encoding="UTF-8"?>
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">

<bean id="efg"//指定名 class="com.abc.Efg"//这里指定相应的java>   
</bean>

   <bean id="abc"//指定名 class="com.abc.Abc"//这里指定相应的java>    <property name="efg" ref="efg />
  </bean>

[/code]

这样你就配置好了,可以建立代码试试了!

新手推荐视频教程。。。http://www.itcast.cn/itcast_static/SpringVideo.htm

但这只是粗略的介绍,深入理解还要详细阅读官方文档和原代码。。。。

首先建立一个web project,然后添加spring jar包,properties>myeclipse>add library>spring。就可以写spring了

电驴去搜个spring视频教程,很快就能上手的,但要想深入,那就得多看看技术类的文章了

晕 这种问题还是要自己多动手去做!
开始的时候最好出错,只有出错多了 然后去查 才能明白为什么那么配,现在给你写出来没有用!