正文
Struts2的配置文件中, <package>的作用,<action><result>重名?
小程序:扫一扫查出行
【扫一扫了解最新限行尾号】
复制小程序
【扫一扫了解最新限行尾号】
复制小程序
问:Struts2的配置文件中, <package>的作用是什么?
答:防止action重名啊,例如前台和后台,总会有很多地方起名重复的!
问:可是访问的时候,不也是访问action吗,能体现package的name的作用吗?
答:不同的package,你难道还要设置一样的namespace吗?!
事实胜于雄辩
1.同样的package,即name相同,namespace不同的话,会报错。
2.不同的package,namespace一样的话,就失去了包的作用,同名action会报错。
3.同namespace下的action都不可重名,否则报错。
4.同action中result不可重名,否则报错。
Struts2的配置文件中, <package>的作用,<action><result>重名?的更多相关文章- Struts2之配置文件中Action的详细配置
在Struts2之配置一文中,我们知道一个struts配置文件可以分为三部分:常量配置 包含其他配置文件的配置 Action配置 . 这其中 常量配置 和 包含其他配置文件的配置 二 ...
- Struts2之配置文件中Action的详细配置(续)
承接上一篇 4.处理结果的配置 Action类的实例对象调用某个方法,处理完用户请求之后,将返回一个逻辑视图名的字符串.核心Filter收到返回的逻辑视图名字符串,根据struts.xml中的逻辑视图 ...
- 过滤器Filter在配置文件中不起作用
web.xml内容 <filter> <filter-name>LoginFilter</filter-name> <filter-class>com. ...
- struts2使用配置文件中使用json-default的问题
使用Struts2实现异步验证数据: 与Struts2相关的jar包如下: freemarker-2.3.13.jar ognl-2.6.11.jar struts2-core-2.1.6.jar s ...
- PHP 配置文件中open_basedir选项作用
如下是php.ini中的原文说明以及默认配置: ; open_basedir, if set, limits all file operations to the defined directory ...
- maven配置文件中modules的作用
modules 从字面意思来说,module就是模块,而pom.xml中的modules也正是这个意思,用来管理同个项目中的各个模块:如果maven用的比较简单,或者说项目的模块在pom.xml没进行 ...
- struts2在配置文件与JSP中用OGNL获取Action属性
参考:Struts与OGNL结合 struts2在配置文件中可以调用Action的属性,在JSP页面也可以取出Action的属性值(前提是属性有get,set方法). 第一个例子: 1.Action中 ...
- struts.xml配置文件(package,namespace,action)
struts2.0 xml配置 struts.xml文件结构 struts.xml文件是整个Struts2框架的核心. struts.xml文件内定义了Struts2的系列Action,定义Actio ...
- Struts2中There is no Action mapped for namespace错误解决方法
1.我的原有配置 jsp表单提交路径 <form class="layui-form" id="form" action="${ctx }/me ...
随机推荐- sqlmap 进阶 (一)
0x1 命令 以此类推,可以具体自己研究有哪些参数,放在哪,有什么用,怎么用 参考:https://blog.csdn.net/bo_mask/article/details/76130848 0x2 ...
- Refs 和 DOM
在常规的 React 数据流中,props 是父组件与子组件交互的唯一方式.要修改子元素,你需要用新的 props 去重新渲染子元素.然而,在少数情况下,你需要在常规数据流外强制修改子元素.被修改的子 ...
- C++ 类 析构函数
一.析构函数的定义 析构函数为成员函数的一种,名字与类名相同,在前面加‘~’没有参数和返回值在C++中“~”是位取反运算符.一个类最多只能有一个析构函数.析构函数不返回任何值,没有函数类型,也没有函数 ...
- Scrum Meeting 6 -2014.11.12
今天apec最后一天,大部分任务都差不多了,局部测试问题不大.大家修复下小细节就可以开始整合了. Member Today’s task Next task 林豪森 协助测试及服务器部署 协助测试及服 ...
- Alpha版本测试文档
概述 本次测试主要是为了测试是否有导致崩溃的bug,验证是否符合软件基本需求. 测试环境 硬件测试:安卓系统手机,安卓平板. 测试人员 赖彦谕,金哉仁. 实际进度 2015/11/6 – 2015/1 ...
- 项目Beta冲刺(团队)第五天
1.昨天的困难 服务器得不到前端返回的数据 教务处网页的源代码的研究有些困难,有些具体数据还不能得到,jsoup还在探索 2.今天解决的进度 成员 进度 陈家权 点赞界面设计 赖晓连 问答功能各项完善 ...
- WCF 和 ASP.NET Web API
地址:https://docs.microsoft.com/zh-cn/dotnet/framework/wcf/wcf-and-aspnet-web-api WCF 是 Microsoft 为生成面 ...
- .NET WinForm下StatusStrip控件如何设置分隔线及部分子控件右对齐
ssInfo.LayoutStyle = ToolStripLayoutStyle.StackWithOverflow;//StatusStrip 控件 tsslUpdate.Alignment = ...
- grep文本处理工具
grep是一款文本过滤工具,基于正则表达式进行模式匹配sed:stream editor 流编辑器awk:linux上实现为gawk,文本报告生成器(格式化文本)文本搜索工具,根据用户指定的模式,对目 ...
- IT行业的个人见解
IT这个行业是近代历史上的新新行业,它的就业前景是非常的好的,就业率高,但是这个行业的需求人才精英不是那些半桶水的所谓IT男.我现在学习的是计算机专业中的软件工程目标是成为一名合格的软件工程师,软件工 ...
在Struts2之配置一文中,我们知道一个struts配置文件可以分为三部分:常量配置 包含其他配置文件的配置 Action配置 . 这其中 常量配置 和 包含其他配置文件的配置 二 ...
承接上一篇 4.处理结果的配置 Action类的实例对象调用某个方法,处理完用户请求之后,将返回一个逻辑视图名的字符串.核心Filter收到返回的逻辑视图名字符串,根据struts.xml中的逻辑视图 ...
web.xml内容 <filter> <filter-name>LoginFilter</filter-name> <filter-class>com. ...
使用Struts2实现异步验证数据: 与Struts2相关的jar包如下: freemarker-2.3.13.jar ognl-2.6.11.jar struts2-core-2.1.6.jar s ...
如下是php.ini中的原文说明以及默认配置: ; open_basedir, if set, limits all file operations to the defined directory ...
modules 从字面意思来说,module就是模块,而pom.xml中的modules也正是这个意思,用来管理同个项目中的各个模块:如果maven用的比较简单,或者说项目的模块在pom.xml没进行 ...
参考:Struts与OGNL结合 struts2在配置文件中可以调用Action的属性,在JSP页面也可以取出Action的属性值(前提是属性有get,set方法). 第一个例子: 1.Action中 ...
struts2.0 xml配置 struts.xml文件结构 struts.xml文件是整个Struts2框架的核心. struts.xml文件内定义了Struts2的系列Action,定义Actio ...
1.我的原有配置 jsp表单提交路径 <form class="layui-form" id="form" action="${ctx }/me ...
- sqlmap 进阶 (一)
0x1 命令 以此类推,可以具体自己研究有哪些参数,放在哪,有什么用,怎么用 参考:https://blog.csdn.net/bo_mask/article/details/76130848 0x2 ...
- Refs 和 DOM
在常规的 React 数据流中,props 是父组件与子组件交互的唯一方式.要修改子元素,你需要用新的 props 去重新渲染子元素.然而,在少数情况下,你需要在常规数据流外强制修改子元素.被修改的子 ...
- C++ 类 析构函数
一.析构函数的定义 析构函数为成员函数的一种,名字与类名相同,在前面加‘~’没有参数和返回值在C++中“~”是位取反运算符.一个类最多只能有一个析构函数.析构函数不返回任何值,没有函数类型,也没有函数 ...
- Scrum Meeting 6 -2014.11.12
今天apec最后一天,大部分任务都差不多了,局部测试问题不大.大家修复下小细节就可以开始整合了. Member Today’s task Next task 林豪森 协助测试及服务器部署 协助测试及服 ...
- Alpha版本测试文档
概述 本次测试主要是为了测试是否有导致崩溃的bug,验证是否符合软件基本需求. 测试环境 硬件测试:安卓系统手机,安卓平板. 测试人员 赖彦谕,金哉仁. 实际进度 2015/11/6 – 2015/1 ...
- 项目Beta冲刺(团队)第五天
1.昨天的困难 服务器得不到前端返回的数据 教务处网页的源代码的研究有些困难,有些具体数据还不能得到,jsoup还在探索 2.今天解决的进度 成员 进度 陈家权 点赞界面设计 赖晓连 问答功能各项完善 ...
- WCF 和 ASP.NET Web API
地址:https://docs.microsoft.com/zh-cn/dotnet/framework/wcf/wcf-and-aspnet-web-api WCF 是 Microsoft 为生成面 ...
- .NET WinForm下StatusStrip控件如何设置分隔线及部分子控件右对齐
ssInfo.LayoutStyle = ToolStripLayoutStyle.StackWithOverflow;//StatusStrip 控件 tsslUpdate.Alignment = ...
- grep文本处理工具
grep是一款文本过滤工具,基于正则表达式进行模式匹配sed:stream editor 流编辑器awk:linux上实现为gawk,文本报告生成器(格式化文本)文本搜索工具,根据用户指定的模式,对目 ...
- IT行业的个人见解
IT这个行业是近代历史上的新新行业,它的就业前景是非常的好的,就业率高,但是这个行业的需求人才精英不是那些半桶水的所谓IT男.我现在学习的是计算机专业中的软件工程目标是成为一名合格的软件工程师,软件工 ...