91-9990449935 0120-4256464 |
Struts 2 Configuration FileThe 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 file struts.xml1) package elementWe 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 elementThe action is the subelement of package and represents an action. Attributes of action element
3) result elementIt is the sub element of action that specifies where to forward the request for this action. Attributes of result element
Other elementsThere are many other elements also such as global-exception-mappings, global-results, include etc. It will be discussed later. |