1.<form-bean>
Contains form bean definitions. The Form beans create ActionForm instances at runtime. The details of each form bean are provided in the <form-bean> element. The <form-property> elements within the form bean contain the property names and the property types of the form bean.
Attributes of <form-bean> are:
-
name : Must have a unique bean name. This name is used as reference in the action mappings. Often, this is also the name of the request or the session attribute under which the form is stored.
-
type : The value is a fully-qualified classname of the ActionForm class used with the form bean.
Attributes of <form-property> are:
-
name : Contains the name of a property of the form bean.
-
type : Contains the property type such as String, String[], etc.
Example Entry
<form-bean name="EventCVForm" type="org.apache.struts.validator.DynaValidatorForm">
<form-property name="cvName" type="java.lang.String"/>
<form-property name="severity" type="java.lang.String[]"/>
......
</form-bean>
2.action-mapping
Contains the action definitions. Each action mapping is defined in an <action> element. The <forward> definition within <action> , maps the result of the action to the jsp page invoked. This is a 'local' forward and is optional. That is, for the particular request object, if there is no forward defined in the global forwards, it is specified in the <action-mapping> element.
Attributes of <action-mappings> are:
-
path : Contains the name of the request received
-
type : Contains the name of the action class invoked
-
scope : Specifies the scope in which the Controller (ActionServlet) must look for the bean
Attributes of (local) <forward> within <action-mappings> are the same as that of the global <forward>.
Example Entry
<action-mappings>
<action path="/NetworkEvent"
type="com.adventnet.nms.webclient.fault.event.EventViewAction"
scope="request">
<forward name="eventView" path="NetworkEventPage" contextRelative="true"/>
</action>
</action-mappings>
In the above entry, when a request matching the specified path (NetworkEvent) is received, an instance of the ActionClass is created. The controller looks for the bean in the specified scope (request) creating and saving a bean of the specified class, if needed. The ActionForward object is returned and the reference to the object is acquired using mapping.findforward .. The layout for the page displaying network events is defined in the corresponding tiles definition file, where the page components and the corresponding JSPs are specified.
更多Struts1中的struts-config.xml属性可以连接:
http://www.webnms.com/webnms/help/developer_guide/web_client/web_struts_config.html