struts配置文件详解(一)

[入库:2006年2月23日] [更新:2007年3月24日]

本文简介:

form beans相关元素:

When the parser meets the beging of the element "from-beans",it fires a rule named SetActionFormBeanClassRule,which sets action mapping class with "type" attribute value,which default value is "org.apache.struts.action.ActionFormBean" which extends "org.apache.struts.config.FormBeanConfig".

And then,the parser processes the nested element,"form-bean".The paraser meets the beging of the element,it fires rule named ActionFormBeanFactory and rule named SetPropertiesRule.

The prior is to create a new instance that type is the element's attribute "className" which default value is "org.apache.struts.action.ActionFormBean",and then pushes it to the parser's object stack.

The latter is to use the standard Java Reflection API to identify any JavaBeans property setter methods (ActionFormBean's instance) who have property names that match the attributes specified on "form-bean" element, and then call them individually, passing the corresponding attribute values.

After that,the parser fires a rule named SetNextRule,the resulting is to store a ActionFormBean's instance previously created into the ModuleConfig's instance.

By analogy,the latter elements are the same.

In a word,the whole process is to create a ActionFormBean's instance based on the form-bean's attributes and subelements,and store it into the ModuleConfig's instance for useing latter.

本文关键:struts配置文件详解(一)
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top