Struts 2 Configuration File
The struts application contains two main configuration files struts.xml file and struts.properties file.
The struts.properties file is used to override the default values of default.xml file provided by struts framework. So it is not mandatory. Mostly, you will not use struts.properties file. We will learn about it later.
Here, we are going to learn all about struts.xml file. First of all let us see the simple example of struts.xml filestruts.xml
1) package element
We can easily divide our struts application into sub modules. The package element specifies a module. You can have one or more packages in the struts.xml file.
Attributes of package element
2) action element
The action is the subelement of package and represents an action.
Attributes of action element
3) result element
It is the sub element of action that specifies where to forward the request for this action.
Attributes of result element
There are many other elements also such as global-exception-mappings, global-results, include etc. It will be discussed later.