文档下载 文档下载导航
设为首页 | 加入收藏
搜索 请输入内容:  
 导航当前位置: 文档下载 > 所有分类 > IT/计算机 > ssh整合步骤
侵权投诉

ssh整合步骤

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>

上一页第2页

热门文档

相关文档

  • ssh整合步骤

    ssh整合步骤_幼儿读物_幼儿教育_教育专区。sshStruts+Spring+Hibernate/SSH Struts1.x/Struts2.x+Hibernate+Spring SpringSide SSH Appfuse : jsp :index.jsp ...

  • ssh框架整合步骤讲解

    ssh框架整合步骤讲解_IT/计算机_专业资料。j2EE开发,基于MyEclipse6.5 的 SSH 整合 hespermoon 2008-7-18 1. 编写目的最近在学习 Struts1.2+Spring2.5+...

  • SSH整合步骤

    SSH整合步骤 struts spring hibernate 整合步骤struts spring hibernate 整合步骤隐藏>> Struts + Spring + Hibernate 的整合使用 开发工具:Eclipse3.1,MyEclipse4....

  • ssh整合步骤

    库ssh 设置编码为utf-8 语句: 042 create database ssh character set 'utf8' collate 'utf8_general_ci' 043 044 045 046 引用 047 048 049 1.先整合...

  • SSH 框架整合步骤详细讲解

    SSH 框架整合步骤详细讲解_计算机软件及应用_IT/计算机_专业资料。保证你一次搭建成功翔云237567685@qq.com 基于 myeclipse 8.6M1 的 三大框架整合 (spring3.0+...

  • SSH整合流程

    SSH整合流程_IT/计算机_专业资料。JAVA框架编程SSH 整合步骤第一步:确定各个框架的版本: 1. Struts2.1,Spring2.5,Hibernate3.2 第二步:在 MYECLIPSE 新建一...

  • SSH整合的关键步骤

    SSH整合的关键步骤_计算机软件及应用_IT/计算机_专业资料。1:修改web.xml(让程序一启动就加载spring的配置文件) <context-param> contextConfigLocation<...

  • SSH三大框架整合步骤

    SSH三大框架整合步骤_IT/计算机_专业资料。SSH三大框架整合步骤SSH三大框架整合 1.创建一个web项目 new project --->web project---> 项目名称ssh 2.添加struts...

  • SSH整合步骤

    SSH整合的关键步骤 2页 2财富值喜欢此文档的还喜欢 ssh框架整合步骤讲解 29页 1财富值 ssh整合文档 17页 免费 ssh 4页 免费 SSH整合示例 6页 2财富值 ...

站点地图 | 文档上传 | 侵权投诉 | 手机版
本站所有资源均来自互联网,本站只负责收集和整理,均不承担任何法律责任,如有侵权等其它行为请联系我们.
文档下载 Copyright 2013 doc.guandang.net All Rights Reserved.  -  email