0、安裝SPRING TOOL SUITE ·SPRING TOOL
SUITE 是一個 Eclipse 插件,利用該插件可以更方便的在
Eclipse 平臺上開發(fā)基于 Spring 的應(yīng)用,。
·安裝方法說明(springsource-tool-suite-3.4.0.RELEASE-e4.3.1-updatesite.zip):
–Help --> Install New Software...
–Click Add...
–In dialog Add Site dialog, click Archive...
–Navigate to springsource-tool-suite-3.4.0.RELEASE-e4.3.1-updatesite.zip and click
Open
–Clicking OK in the Add Site dialog will bring you back to the dialog
'Install'
–Select the xxx/Spring IDE that has appeared
–Click Next and then Finish
–Approve the license
Restart eclipse when that is asked1. 加入 Spring 1). 加入 jar 包 E:\工具\編程開發(fā)\SSH\spring-framework-4.0.0.RELEASE-dist\spring-framework-4.0.0.RELEASE\requiredcom.springsource.net.sf.cglib-2.2.0.jar com.springsource.org.aopalliance-1.0.0.jar com.springsource.org.aspectj.weaver-1.6.8.RELEASE.jar commons-logging-1.1.3.jar spring-aop-4.0.0.RELEASE.jar spring-aspects-4.0.0.RELEASE.jar spring-beans-4.0.0.RELEASE.jar spring-context-4.0.0.RELEASE.jar spring-core-4.0.0.RELEASE.jar spring-expression-4.0.0.RELEASE.jar spring-jdbc-4.0.0.RELEASE.jar spring-orm-4.0.0.RELEASE.jar spring-tx-4.0.0.RELEASE.jar spring-web-4.0.0.RELEASE.jar spring-webmvc-4.0.0.RELEASE.jar 2). 配置 web.xml 文件 ctrl+sift+f atl+/ 選中 ContextLoaderListener<web-app xmlns:xsi="http://www./2001/XMLSchema-instance" xmlns="http://java./xml/ns/javaee" xsi:schemaLocation="http://java./xml/ns/javaee http://java./xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> <!-- needed for ContextLoaderListener --> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:applicationContext.xml</param-value> </context-param> <!-- Bootstraps the root web application context before servlet initialization --> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> </web-app> 3). 加入 Spring 的配置文件. 新建source folder新建一個spring bean configuration file
applicationContext.xml 自動加載:xsi:aop;context,;tx <beans xmlns="http://www./schema/beans" xmlns:xsi="http://www./2001/XMLSchema-instance" xmlns:aop="http://www./schema/aop" xmlns:context="http://www./schema/context" xmlns:tx="http://www./schema/tx" xsi:schemaLocation="http://www./schema/beans http://www./schema/beans/spring-beans.xsd http://www./schema/aop http://www./schema/aop/spring-aop-4.0.xsd http://www./schema/context http://www./schema/context/spring-context-4.0.xsd http://www./schema/tx http://www./schema/tx/spring-tx-4.0.xsd"> </beans> |
|