Struts and Spring的整合总结

来源:百度文库 编辑:神马文学网 时间:2024/04/27 19:14:43
第四步:在web.xml文件中添加spring的监听内容如下: contextConfigLocation classpath:applicationContext*.xml org.springframework.web.context.ContextLoaderListener 第五步:指定加载applicationContext.xml文件的加载路径内容如下: 注意:如果不添加该内容则。。。。。。。。。。。。 以上内容为信息的配置,下面是进行jsp and Action 等………… 第六步:整合案例如下: 1:新建jsp:index.jsp ss.actionasdfasdf 2:新建jsp:main.jsp 3:新建Action:在包 package edu.ncbuct.action;import com.opensymphony.xwork2.ActionSupport;public class SsAction extends ActionSupport{ private String msg; public String getMsg() { return msg; } public void setMsg(String msg) { this.msg = msg; } public String execute(){ msg += "OK"; return "success"; }}