bharanitharan
bharanitharan

Reputation: 2629

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?

Upvotes: 13

Views: 18079

Answers (6)

Clarence
Clarence

Reputation: 936

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

Upvotes: 3

naidu
naidu

Reputation: 350

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

Upvotes: 0

hkadejo
hkadejo

Reputation: 162

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

Upvotes: 1

Jwalin Shah
Jwalin Shah

Reputation: 2531

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.

Upvotes: 1

user159088
user159088

Reputation:

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

Upvotes: 13

krock
krock

Reputation: 29629

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.

Upvotes: 2

Related Questions