A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

 找回密码
 加入黑马

QQ登录

只需一步,快速开始

本帖最后由 我是楠楠 于 2019-5-15 15:20 编辑

【郑州校区】服务器实现添加收派标准 struts2 表现层
pom.xml 导入 struts2 坐标
struts2 基本开发
Struts2 和 spring 整合
Struts2 注解开发

struts2-convention-plugin
struts-plugin.xml
配置扫描 struts2 Action 类
指定后缀的类

struts2 注解
类上
@ParentPackage 包基础谁? extends=”struts-default”
@Namespace 包命名空间 namespace=”/”
@Actions struts2 的 Action 配置,用于配置多个 Action
方法上
@Action 配置访问路径,和方法绑定
@Result 结果集配置
l
struts2 和 spring 整合
struts2 的 Action 使用 spring 注解,被 spring 管理
@Controller spring 表现层 bean
@Scope 配置 Action 为多例
错误: 忘记配置 struts2 核心过滤器
web.xml





思考:为什么 Action 处理请求,转发回页面会显示空白 ?

设置 type=”redirect” 重定向回页面解决问题
传智播客·黑马程序员郑州校区地址
河南省郑州市 高新区长椿路11号大学科技园(西区)东门8号楼三层
联系电话 0371-56061160/61/62

来校路线  地铁一号线梧桐街站A口出

0 个回复

您需要登录后才可以回帖 登录 | 加入黑马