بیشترلیست موضوعات • Index • ExamplesApache Jakarta and Beyond: A Java Programmers Introduction By
Larne Pekowsky Publisher : Addison Wesley Professional Pub Date : December 30, 2004 ISBN : 0-321-23771-4 Pages : 608
توضیحاتافزودن یادداشت جدید
19.6. The Pros and Cons of Struts
It should be clear at this point that struts provides a very clean, very sharp distinction between model, view, and controller. It also simplifies some aspects of creating the view by communicating problems to the user in a flexible way and maintaining valid inputs as errors are corrected. These are undeniably good things.However, these benefits are not without their costs. It is also clear that using struts adds a great deal of overhead. Creating a new form requires creation of at least an action handler, plus possibly a form bean, plus several entries in several different files. On sites with many forms the configuration files may become overwhelming.In the process of adding a new page and fine-tuning the entries in the XML file it is likely that Tomcat, or at least the particular Web application, will need to be restarted several times. This may take only thirty seconds each time, but those delays quickly add up.It must also be said that struts's error reporting leaves a very great deal to be desired. Any mistake in the configuration, including mistyping the location of the application or config files, omitting the load-on-startup flag or any syntactic errors will result in the utterly unhelpful error message "Cannot find Action-Mappings or ActionFormBeans collection." There is no way to narrow down what