简体   繁体   中英

struts.xml and 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?

The core configuration file for the Struts framework is by default the struts.xml for Struts 2 and struts-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 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..

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.

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.xmlStruts2配置文件struts-config.xml,而名称一般都有Struts配置文件(1.3.x)

struts-config.xml是默认配置文件,由struts 1.x框架提供,其中struts.xml是struts 2.x的配置文件

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM