struts1+hibernate+spring整合步骤...
BeanFactory factory = new ClassPathXmlApplicationContext("classpath*:applicationContext.xml");
IProductBiz probiz = (IProductBiz) factory.getBean("probiz");
8.如果成功,添加Struts的jar文件及其配置文件(Struts的配置文件放在WEB_INF下的lib文件夹里)
8-1.创建web包,并且在web包里创建Struts的两大组件包web.forms(需要继承actionform) 和web.actions(继承DispatchAction'分发式Action')注:在action里添加业务逻辑接口的引用,并
提供Set方法,
即:private IProductBiz probiz = null;
public void setProbiz(IProductBiz probiz) {
this.probiz = probiz;
}
8-2.在Struts的主配置文件里配置Struts的form及action(注:在Struts的具体action的type应该配成为
Spring的一个代理:org.springframework.web.struts.)
8-3.在Spring的主配置文件里添加处理业务的具体Action。即让具体的Action让Spring来管理起来,可以
通过:
<bean name="/product" class="web.actions.ProductAction">
<property name="probiz" ref="probiz"></property>
</bean>将probiz接口注入到action里
9.此时有两种方式可以9.1监听器整合struts和spring ////9.2通过插件来整合struts和spring
9.1.监听器整合struts和spring
在web.xml文件里添加:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener>
9.2.通过插件来整合struts和spring
在Struts的主配置文件里添加:
<plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property property="contextConfigLocation" value="classpath*:applicationContext.xml"/>
</plug-in>
ssh整合步骤_幼儿读物_幼儿教育_教育专区。sshStruts+Spring+Hibernate/SSH Struts1.x/Struts2.x+Hibernate+Spring SpringSide SSH Appfuse : jsp :index.jsp ...
ssh框架整合步骤讲解_IT/计算机_专业资料。j2EE开发,基于MyEclipse6.5 的 SSH 整合 hespermoon 2008-7-18 1. 编写目的最近在学习 Struts1.2+Spring2.5+...
SSH整合步骤 struts spring hibernate 整合步骤struts spring hibernate 整合步骤隐藏>> Struts + Spring + Hibernate 的整合使用 开发工具:Eclipse3.1,MyEclipse4....
库ssh 设置编码为utf-8 语句: 042 create database ssh character set 'utf8' collate 'utf8_general_ci' 043 044 045 046 引用 047 048 049 1.先整合...
SSH 框架整合步骤详细讲解_计算机软件及应用_IT/计算机_专业资料。保证你一次搭建成功翔云237567685@qq.com 基于 myeclipse 8.6M1 的 三大框架整合 (spring3.0+...
SSH整合流程_IT/计算机_专业资料。JAVA框架编程SSH 整合步骤第一步:确定各个框架的版本: 1. Struts2.1,Spring2.5,Hibernate3.2 第二步:在 MYECLIPSE 新建一...
SSH整合的关键步骤_计算机软件及应用_IT/计算机_专业资料。1:修改web.xml(让程序一启动就加载spring的配置文件) <context-param> contextConfigLocation<...
SSH三大框架整合步骤_IT/计算机_专业资料。SSH三大框架整合步骤SSH三大框架整合 1.创建一个web项目 new project --->web project---> 项目名称ssh 2.添加struts...
SSH整合的关键步骤 2页 2财富值喜欢此文档的还喜欢 ssh框架整合步骤讲解 29页 1财富值 ssh整合文档 17页 免费 ssh 4页 免费 SSH整合示例 6页 2财富值 ...
热门文档