What is the difference between struts.xml and struts-config.xml? Are both the same or is there any difference betwee开发者_如何学编程n 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.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 is default configuration file,that was given by struts 1.x framework, where as struts.xml is configuration file for struts 2.x
精彩评论