·        Struts configuration file:
o       It is the heart of struts application because this file contain configuration that are required to generate integration logic of controller layer dynamically
o       Any filename.xml takes as struts configuration file, but it has to be specified in web.xml file as configuration init parameter value
o       If no filename explicitly specified as struts configuration file , then ActionServlet looks to take struts-config.xml file of  WEB-INF folder as default struts config file
·        Struts configuration file : it contains following configuration
o       Formbean
o       Action classes
o       Action forwards config
o       Plug-in
o       Exception config and etc
·        The web container (or) servlet container web server reads web.xml file content by xml parser called sax parser
·        Action servlet reads struts config file content by using xml parser called sax parser. This sax parser s/w is built in s/w of web server s/w and in struts framework s/w
·        In java, an abstract class can contain only abstract method or only concrete method or both
o       Example:
§         Java.servlet.http.httpservlet is abstract class contain only concrete method
§         Org.apache.struts.action.Actionform is an abstract class contain only concrete methods
§         In order to make certain class logic and definition should visible only through sub class then the class will be taken as abstract class contain concrete method definition
§         In order to make action servlet using logics of org.apache.struts.action.Actionform class through sub classes called programmer developed form bean classes the predefined
·        Action class is given as abstract classes though all the methods of that class are concrete methods
·        Form Bean class:
o       The java class or the java bean that extends form org.apache.struts.action.Actionform class is called Form bean class
o       The form bean class contain number variable to hold form data supplied by form page through action servlet.
o       These number variables called form bean properties and this name must match with form page components like textbox name. select box name and etc
o       // registerform.java
Package p1;
Public class Registerform extends org.apache.strut.action.Actionform
{
// form bean property
String username, password;
Public void setusername(String uname)
{
This.username=uname;
}
Public void setpassword(String pwd)
{
This.password=pwd;
}
Public string getUsername()
{
Return username;
}
Public string password()
{
Return password;
}
}


o       Every form bean property in form bean class one setter method and one getter method
o       Every form bean class must be configuration as struts configuration file having logical name as show below
o       In struts configuration file
<form-beans>
<form-bean name=”rf” type=”p1.registerform/>
</form-beans>
Note:
rf is logical name of formbean configuration  and p1 is fully qualified java class that is acting as form bean class
o        Form bean class of struts application is identified by other resources of web application or struts application through its logical name
·        Struts Action class:
o       The java class that extend from org.apache.struts.action.Action class is called struts action class
o       Struts action class is configured in struts configuration file having action path as identification name
o       Every servlet is identified through its URL pattern. Similarly every struts action classes. Identified through its action path given in struts configuration file
o       // RegisterAction.java
Package p1;
Public class registeraction extends org.apache.strut.action.Action
{
Public Actionforward execute (-,-,-,-)
{
------------------
-----------------
Business logic
-----------------
}
Return Action forward object
}
}

·        The process of linking form bean with action class  Actionforward based result pages with action class and configuring action class having action path is called action mapping operating and this will be done in struts configuration file as show below
Note:

1=form beans configuration logical name
2=java class that is acting as form bean class
3=action path of struts action class configuration
4=form bean class logical name based on this form bean class will be associated with logical name
5=fully qualified name of action class action as struts action class
6=action forward logical name
7=result page pointed by action forward and also linked as result page of struts result page

Note:
o       By writing <forward> As sub tag of <action> we can link Actionforward based result page with struts action class
o       Every action forward configuration will identify with its logical name(name attribute values give in <forward>