ssh oracle搭建项目,ssh项目环境搭建步骤(web项目)

一、创建Web项目

二、加入Struts2支持(Struts-2.3.1.2版本)

1、   拷贝相关jar包到lib目录下

(1)      struts2-core-2.3.1.2.jar

(2)      xwork-core-2.3.1.2.jar

(3)      ognl-3.0.4.jar

(4)      freemarker-2.3.18.jar

(5)      commons-logging-1.1.1.jar

(6)      commons-io-2.0.1.jar

(7)      commons-lang-2.5.jar

(8)      commons-fileupload-1.2.2.jar

(9)      javassist-3.11.0.GA.jar

(10)  struts2-spring-plugin-2.3.1.2.jar(整合Spring)

2、   配置web.xml文件

(1)      打开struts-2.3.1.2\apps\struts2-blank.war文件,查看其中web.xml配置

(2)      拷贝相关内容如下:

struts2

org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter

struts2

/*

3、拷贝struts-2.3.1.2\apps\struts2-blank.war中的struts.xml文件到src下,大致内容如下:

/p>

"-//ApacheSoftwareFoundation//DTDStrutsConfiguration2.0//EN"

"http://struts.apache.org/dtds/struts-2.0.dtd">

/error.jsp

4、增加相关的Xxx.hbm.xml文件到相应的包下面,内容大致如下:

/p>

"-//Hibernate/HibernateMappingDTD3.0//EN"

"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

三、增加Spring支持(Spring-framework-2.5.6版本)

1、拷贝相关jar包到lib目录下

(1)spring.jar

(2)aspectjweaver.jar

2、在spring-framework-2.5.6\samples目录下拷贝applicationContext.xml到src目录下面,并修改文件名为applicationContext-common.xml,大致内容如下

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xmlns:aop="http://www.springframework.org/schema/aop"

xmlns:tx="http://www.springframework.org/schema/tx"

xsi:schemaLocation="

http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans-2.5.xsd

http://www.springframework.org/schema/aophttp://www.springframework.org/schema/aop/spring-aop-2.5.xsd

http://www.springframework.org/schema/txhttp://www.springframework.org/schema/tx/spring-tx-2.5.xsd">

3、修改web.xml配置文件,增加内容如下:

[coe]

org.springframework.web.context.ContextLoaderListener

contextConfigLocation

classpath:applicationContext-*.xml

[/code]

四、增加Hibernate支持(Hibernate-distribution-3.6.10.Final)

1、拷贝相关包到lib下,包括hibernate-distribution-3.6.10.Final\lib\required文件夹下相关jar文件,jar如下列表:

(1)hibernate3.jar

(2)antlr-2.7.6.jar

(3)commons-collections-3.1.jar

(4)dom4j-1.6.1.jar

(5)jta-1.1.jar

(6)slf4j-api-1.6.1.jar

(7)hibernate-jpa-2.0-api-1.0.1.Final.jar

2、拷贝数据库相关的jar文件到lib下,如:mysql-connector-java-5.1.18-bin.jar

五、整合Hibernate和Spring

1、修改applicationContext-common.xml文件,增加内容如下:

com/oracle/po/Customer.hbm.xml

org.hibernate.dialect.MySQLDialect

true

update

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值