shh环境配置——Spring与struts整合
来源:互联网 发布:时间碎片是什么软件 编辑:程序博客网 时间:2024/06/16 03:13
首先加入Struts包,其次配置web.xml,再者写action类,接着配置action.xml,然后引入Struts.文件配置。最后发布测试。
第一步引入包
第二步
1.struts核心过滤器
<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>*.action</url-pattern>
</filter-mapping>
2.spring监听器。
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:bean.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
3.引入配置action.xml
<bean id="userAction" class="cn.itcast.web.UserAction" scope="prototype">
<property name="userService" ref="userService"></property>
注意设置Scope=“prototype”
4.配置Struts.xml
<struts>
<!-- 常量配置 -->
<!-- 1.struts 使用简单样式主题-->
<package name="user" extends="struts-default">
<action name="user_*" class="userAction" method="{1}">
<result name="success">/index.jsp</result>
</action>
</package>
</struts>
- shh环境配置——Spring与struts整合
- 粗谈Spring与Struts的整合——从实现的Struts的扩展点上看Spring与Struts的整合
- 整合Struts 与Spring
- 整合Struts 与Spring
- 整合Struts 与Spring
- struts与spring整合
- spring与struts整合
- Spring与Struts整合
- Spring与Struts整合
- Spring与struts整合
- Spring与Struts整合
- spring 与struts 整合
- struts与spring整合
- Spring与Struts整合
- spring与struts整合
- shh整合后web.xml、spring配置文件和struts.xml的内容
- shh整合后web.xml、spring配置文件和struts.xml的内容
- Spring与Struts如何整合
- eBGP、IBGP 传递路由
- 流式布局FlowLayout
- Unity UGUI的各种属性
- POJ3268 Silver Cow Party
- LayUI表单获取不到data的解决办法
- shh环境配置——Spring与struts整合
- 机器学习总结(十一):深度学习算法(CNN,SAE,等)及常见问题总结
- [分享]活动家盘点7场关于人工智能会议 让投资更值当!
- C语言问题记录
- Java之利用Freemarker模板引擎实现代码生成器,提高效率
- 错误: 无法访问HttpRequestBase 找不到org.apache.http.client.methods.HttpRequestBase的类文件
- matlab pca解释
- react模板
- Android Activity跳转另一个Activity(显示意图)