struts.xml and struts-config.xml
Asked Answered
R

6

13

What is the difference between struts.xml and struts-config.xml? Are both the same or is there any difference between them?

Rover answered 7/6, 2010 at 10:37 Comment(0)
B
13

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).

Bourg answered 7/6, 2010 at 10:45 Comment(0)
O
3

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..

Olag answered 3/7, 2012 at 9:26 Comment(0)
I
2

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.

Imp answered 7/6, 2010 at 10:46 Comment(0)
S
1

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.

Sechrist answered 15/11, 2011 at 13:12 Comment(0)
N
1

struts.xml is the Struts2 configuration file struts-config.xml while is the name generally has the Struts configuration file (1.3.x)

Ninnyhammer answered 15/11, 2011 at 19:47 Comment(0)
V
0

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

Virtually answered 30/5, 2012 at 6:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.