Struts 2 Annotation Introduction

In the Apache struts 2 framework there are two forms of configuration provided by the apache software foundation. The most used way is to use the struts.xml file for all the configurations placed in the default package. We have seen so many examples of that in the tutorials so far. The other 2nd way of configuring Struts is by using the  Annotations feature introduced in the Java 5 version. Using the struts annotations, we can achieve Zero Configuration. we don't need the configuration file, all the configuration has been done by the annotation feature.

There are two ways of  configuring the strtuts 2 based web applications, the two ways are as follows:-

    1. XML based configuration By using the "struts.xml" file.

    2. Annotation based configuration.