Struts 1.2.2 new functional experience (1)

xiaoxiao2021-03-06  73

Struts 1.2.2 experience new features (a) Date: 2004-09-01 Author: 2002PP

Struts 1.2.2 was officially released yesterday, and believes that struts fans must not wait to experience one. The following is the first experience of my Struts 1.2.2.

(-) Org.apache.struts.Action.Action changes.

Adding addMessages, AdderRors, GeterRors, getMessages, which are added in the Action class, to facilitate processing ActionMessages and ActionerRRORS.

I. Protected Void AddMESSAGES (HTTPSERVLETREQUEST REQUEST, ACTIONMESSAGES MESSAGES)

II. Protected void adderrrs (httpservletRequest Request, ActionerrorS Errors)

Iii. Protected actionerrors getErrors (httpservletRequest request)

Iv. Protected actionMessages getMessages (httpservletRequest request)

The following code snippet is about ActionMessages (ActionerRORS):

ActionMessages messages = getMessages (request); // xx.xx.xx Resource Bundle representative of the Key value .ActionMessage msg = new ActionMessage ( "xx.xx.xx"); messages.add (ActionMessages.GLOBAL_MESSAGE, msg); addMessages Request, Messages;

// Do not need to call SaveMessages in 1.2.2 to save the ActionMessages object to Request./ because this feature already contains this feature in AddMessages.

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

New Post(0)