SSH整合开发的技术思考
2013-12-24 16:53
281 查看
ssh整合开发,互联网上上可以找到很多必要的jar包,把需要的包加入就可以实现,搭建的框架,而且这个比较简单,struts.xml和applicationcontext.xml,归根结底加载到这个文件实在web-inf的目录下实现,所以在配置文件找不到时可以,可以把配置文件copy到wen-inf下:
web.xml配置:
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<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>
struts2.xml配置:
<struts>
<package name="exam-default" extends=""struts-default"">
<action path="/deviceAPVersionAction" type="com.action.deviceAPVersionAction" scope="request" parameter="method" >
<forward name="init" path="/webtv/deviceappstoreversionconfig/deviceAppStoreVersionConfig.jsp">
</forward>
</action>
//这个plug-in将struts的处理转给Spring了,由Spring IOC控制调用Struts中的组件,这样你就需要在Spring那个applicationContext.xml中加入Action相应的bean类
<plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property property="contextConfigLocation" value="/WEB-INF/classes/applicationContext.xml"/>
</plug-in>
</package>
</struts>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
web.xml配置:
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<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>
struts2.xml配置:
<struts>
<package name="exam-default" extends=""struts-default"">
<action path="/deviceAPVersionAction" type="com.action.deviceAPVersionAction" scope="request" parameter="method" >
<forward name="init" path="/webtv/deviceappstoreversionconfig/deviceAppStoreVersionConfig.jsp">
</forward>
</action>
//这个plug-in将struts的处理转给Spring了,由Spring IOC控制调用Struts中的组件,这样你就需要在Spring那个applicationContext.xml中加入Action相应的bean类
<plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property property="contextConfigLocation" value="/WEB-INF/classes/applicationContext.xml"/>
</plug-in>
</package>
</struts>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
相关文章推荐
- SSH整合开发--酒店预订系统-->使用Struts技术开发表现层程序
- ssh整合之开发步骤
- Struts+Spring+Hibernate/SSH整合开发详细二
- SSH整合开发步骤详解
- 技术总结—基于SSH的项目开发
- SSH整合开发详细二
- SSH+Oracle整合开发错误6,想要一口吃成大胖子是不行的
- 《轻量级Java Web整合开发入门SSH》 - 快速理解Java框架的又一积木
- Ssh整合开发介绍和简单的登入案例实现
- 区块链开发技术路线选择的思考(之一)
- Shiro整合SSH开发3:配置Shiro认证后页面地址跳转问题(和详述不配置须要注意的问题)
- 用classload技术开发可实时更改复杂地风控规则或者业务规则的应用--思考
- SSH整合开发详细二
- Shiro整合SSH开发1:整合Shiro+Struts2+Spring+Hibernate 初步整合配置【基于Maven】
- 框架学习之Spring 第五节 SSH整合开发[Spring2.5+Hibernate3.3+Struts2]
- SSH开发几个技术点
- java引起的思考——B/S,C/S+富客户端技术+嵌入式开发
- ssh整合开发中的分页方案(Srtuts2+Spring+Hibernate)
- MyEclipse 开发 SSH 整合时 java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit 解决方案
- 区块链开发技术路线的思考(二)