71. What we will define in struts-config.xml file.

The main control file in the Struts framework is the struts-config.xml XML file, where action mappings are specified.

This file’s structure is described by the struts-config DTD file, which is defined at http://jakarta.apache.org/struts/. A copy of the DTD can be found on the /docs/dtds subdirectory of the framework’s installation root directory. The top-level element is struts-config.

Basically, it consists of the following elements:
data-sources—A set of data-source elements, describing parameters needed to instantiate JDBC 2.0 Standard Extension DataSource objects

      <data-source    autoCommit=”false”
                              description=”Second Database Config”

form-beans—A set of form-bean elements that describe the form beans that this application uses

         <form-bean name=”searchForm”>

global-forwards—A set of forward elements describing general available forward URIs

          <forward name=”search” path=”/search.jsp” />

action-mappings—A set of action elements describing a request-to-action mapping

         <action path=”/search”
          <forward name=”results” path=”/results.jsp” />

4 Responses

  1. 1.Global Forwards:




    5.Validator Plugins

  2. Request processor is : org.apache.struts.action.RequestProcessor in struts. Get more detail about it from the struts documentation.

  3. There are cases when you want to replace or extend RequestProcessor to have your own specialized processor. For instance, when using Tiles (a JSP page template framework) in conjunction with Struts, you would use TilesRequestProcessor.

  4. i hava seen a forward element inside an action element of action mapping with the path of forward element not refering to a jsp page of anyother action!! it ends with some thing like this “.index” . and the context relative attiribute of forward is also set to false!! what does it mean???

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: