struts.xml 和 struts-config.xml
struts.xml 和 struts-config.xml 有什么区别?两者是相同的还是有什么区别?
What is the difference between struts.xml and struts-config.xml? Are both the same or is there any difference between them?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
Struts 框架的核心配置文件默认为 Struts 2 的
struts.xml
和 Struts 1 的struts-config.xml
。它们都是配置文件,因此相同,但它们是不同的野兽,因为它们引用了不同版本的 Struts 框架。
Struts 1 和 2 之间存在很大差异,您可以参见此处。
这些文件具有不同的结构和内容,因此您无法真正将其中一个与另一个进行比较(除了它们的用途)。
The core configuration file for the Struts framework is by default the
struts.xml
for Struts 2 andstruts-config.xml
for Struts 1.They are both configuration files so that is the same, but they are different beasts because they refer to different versions of the Struts framework.
There are large differences between Struts 1 and 2 as you can see here.
The files have different structure and content so you can't really compare one with the other (except for their purpose).
struts.xml是Struts2配置文件,
我们无法更改此文件名,如果我们更改此名称,框架将无法识别该配置文件...还有一件事每个 Struts2 应用程序应该只有一个 struts.xml 文件。
其中 Struts 1.x 默认配置文件是 struts-config.xml ,
我们可以更改默认配置文件名,并且可以有多个配置文件。
struts.xml is the Struts2 configuration file,
we can not change this file name, if we change this name Framework could not identified the configuration file... and one more thing per single Struts2 application there should only single struts.xml file.
where as in Struts 1.x default configuration file is struts-config.xml
in this we can change the default configuration file name and we can have multiple configuration files..
它们基本上是相同的文件,您可以在其中配置 struts 操作等,但适用于不同版本的 struts。 struts 1 中的 struts-config.xml 和 struts 2 中的 struts.xml。
They are the basically the same file, where you configure your struts actions etc. but for different versions of struts. struts-config.xml in struts 1 and struts.xml in struts 2.
基本上,struts.xml 是struts2 的配置文件,其中包括jsp 和action 文件的映射。 Strus-config.xml 是 struts1.x 的文件,其中包括操作文件的映射。在struts2中,过滤器被视为前端控制器,定义在struts.xml中;对于struts1.x,Action Servlet被视为前端控制器,并映射到struts-config.xml中。
Basically, struts.xml is configuration file for struts2 which includes mapping of both jsp and action file. Strus-config.xml is the file for struts1.x which included mapping of actions files. In struts2 filter is considered as a front end controller which define into the struts.xml and for struts1.x, Action Servlet is considered as a front-end controller and its mapped into the struts-config.xml.
struts.xml是Struts2配置文件struts-config.xml,而名字一般都有Struts配置文件(1.3.x)
struts.xml is the Struts2 configuration file struts-config.xml while is the name generally has the Struts configuration file (1.3.x)
struts-config.xml是默认配置文件,由struts 1.x框架给出,其中struts.xml是struts 2.x的配置文件
struts-config.xml is default configuration file,that was given by struts 1.x framework, where as struts.xml is configuration file for struts 2.x