struts2与Spring集成步骤_struts2框架技术入门
struts2与Spring集成步骤由刀豆文库小编整理,希望给你工作、学习、生活带来方便,猜你可能喜欢“struts2框架技术入门”。
1、创建web project SS22、导入spring框架,core包、webLibraries包
3、导入struts2框架,core包导入还需要导入struts2-spring-plugin包
注意:可以通过右键选择configure build path,选择Add LibraryMyEclipse libraries,添加所需要的包
4、编写action---cn.edu.njupt.actions.UserAction5、配置struts.xml
succe.jsp
6、配置web.xml
contextConfigLocation
clapath:applicationContext.xml
org.springframework.web.context.ContextLoaderListener
struts2
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
struts2
/*
注意:a、指明applicationContext.xml的位置 b、编写spring的Listener c、struts2的配置信息保持不变
7、配置applicationContext.xml 注意:id需要和Struts.xml中对应Action配置节点中的cla属性(此时的cla属性与action类名无关)保持一致,scope设置为prototype
《struts2与Spring集成步骤.docx》
将本文的Word文档下载,方便收藏和打印
推荐度:
点击下载文档
[其他范文]热门文章