Powered by Blogger.

4.5.Struts configuration file

>> Sunday, June 21, 2009

The struts-config.xml  file is heart of the struts-application containing FormBean classes,Action classes configuration , the entries in this xml file will be read by framework software.
  • Reading entries of web.xml is the responsibility of under laying web server or application server, application servers are using sax api, sax parser to read and process web.xml file.
  • Struts framework software uses SAX parser, SAX api to read and process struts configuration file.
  • Any "filename.xml" can become struts configuration file but it must be specified as input value to ActionServlet by using its init parameter 'config'.
  • In order to develop a resource of an application if there is a rule that class of resource should implement a pre-defined interface of extending from predefined class then reourse is called API dependent .Our servlet classes are API dependent because engther they needs to extends from predefined GenericServlet/HttpServlet class or they need to implement predefined 'servlet' Interfaces.
  • In Struts 1.x application FormBean classes and Action classes are API dependent.
The java class that extends from org.apache.struts.Action, org.apache.struts.action.ActionForm class is called FormBean class. To store form data FormBean class contains instance variables there are called FormBean properties.

Names of FormBean properties is FormBean class must match with the Form components logical names of JSP form/html form.

Every FormBean class of Struts application must be configured in struts configuration file having logical name.

FormBean class is identified by other resources of struts application based on its logical name.

to understand this mappings you read Basic Struts Application.

Related Posts Plugin for WordPress, Blogger...
© javabynataraj.blogspot.com from 2009 - 2014. All rights reserved.