开发者

why using xml files in form validation in server side?

开发者 https://www.devze.com 2023-03-09 19:34 出处:网络
what is the benefit from using xml files in server side validation, in struts, fo开发者_如何学编程r example, XML files are used in validation, here\'s an example http://www.vaannila.com/struts-2/strut

what is the benefit from using xml files in server side validation, in struts, fo开发者_如何学编程r example, XML files are used in validation, here's an example http://www.vaannila.com/struts-2/struts-2-example/struts-2-validation-using-xml-example-1.html, and other practise to put all forms specification into XML file and parse it once then cashe the resulted object in order to use it in another time without the need to parse XML file again "the concept of lazy initialization". I want to know why using XML??


1) It's a file that can be configured easily without recompiling the application much the same as an app.config file

2) Advantage over app.config is that this validation file is specific to a single task, reducing the risk that would be incurred if the main app.config was edited and updated.

So basically you can now if you like put a GUI editor in front of the xml file and provide a means for administrators to modify the contents in a live environment.

Storing the data in a database would give you similar benefits, but it's a rather heavy weight solution to the problem.

0

精彩评论

暂无评论...
验证码 换一张
取 消