Combine the Struts's ActionForm with the CASTOR's XML data binding.

xiaoxiao2021-03-06  108

The combination of ActionForm and Castor's XML data binding can be obtained. 1. This is the biggest benefit to use XSD to describe ActionForm, which is very specified by the code generated by Castor, and is more convenient to note. 2. Using Castor's unmarshal and Marshal can be easily loaded and written back from XML files. You can use Marshal to generate Tostring features. 3. You can call the Validate of CaStor in the actionform. That can make full use of the element constraint rules defined in XSD. Disadvantages, 1. The code should be integrated by hand. This way, if you modify the XSD, some integrated code is a bit more troublesome. 2. Back of the Boolean type variable returns, Castor is not a standard ISXXX (), but getxxx (), in order to meet the JavaBean specification, this method must also be manually added. There is an article here, I haven't seen it carefully: http://www.matrix.org.cn/Article/698.html

转载请注明原文地址:https://www.9cbs.com/read-102051.html

New Post(0)