Base Simple Tag Support, Base Tag Support, Base Body Tag Support, Action Tag

xiaoxiao2021-03-05  26

When using the JSP tag, a large number of operational code is repeated, these codes are set to BasesImpleTagsupport, BaseTagsupport, BasebodyTagsupport, three labels support parent class, inherited three basic classes, SimpleTagsupport, BaseTagsupport, Basebodytagsupport. As in most cases, use SimpleTagSupport to set the variables on the page, combined with the Logic tab and the PageDefault tag, and you can use the bean / invoke tag to access the maturity of each Java object, and realize people who don't understand Java can be directly "Write program" on HTML; unless it is necessary to embed or loop, it is not necessary to use two more complex tags. All JSP tags can complete all of these three tags that complete the specified feature, of course, can also directly inherit their parent classes, then self-implementing code - actually overrides the parent class method. The three labels are concentrated in the following general features:

Completion of the ActionerRors class that is generally completed; generates a blank this class action ActionerRors class to load an error message when the error; complete the log preparation, including the unified output of the error point, and related variables, (the program is not output normally ); Errors error steering target, if "None" does not make error steering, if it is empty, automatically collect the default error page; Nexto target, the next redirect target after the operation, you can use the Source, if you are empty, Do not turn to automatically complete the tag internal variable reset;

It is not the same as that of BaseSimpleTagsupport and the neutral NEXTO. Since SimpleTagsupport has only one body content, no matter whether it is wrong or the purpose of purpose, there is no difference, just the change of the steering object. The latter, there is three individual contents of DOEND, DOSTART, and DOAFTER. If the dostarttag turns, it is obvious that the NEXTO steering from BaseTagsupport and BasebodyTagsupport is executed in DOEND, and if an error occurs, turn to the error page at any position The default is the Errors.jspActionTag tag inherited BasesImpleTagsupport, which is all parent tags for operation types, equivalent to the ActionServlet in Struts, which complete the following work, which is mainly for database records:

Collecting an Actionform object from the request, as the foundation of the MVC; according to the comparison of the context condition and the DAO entity, the permission control of the data operation can be implemented, the specific control definition method is defined by the entity.privileges.privilege-object object in DAO. (XML Decision) Verify the specified FORM domain, similar to the use of Jakarta.valiDator. DeleteTag, Appendta, BatchDetetag, ModifyTAG, etc., are DMO operations for database objects, in general, as long as the ENT type can read and write and batch, the special processing type can inherit the corresponding class, then To cover the REPRO method, achieve maximum code reuse and modular organizations.

Posted Friday, 22 April 2005

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

New Post(0)