To summarize, the difference between the classes ActionErrors/ActionError/ActionMessages/ActionMessage has absolutely nothing to do with the difference in behavior in Action.saveErrors(...) and Action.saveMessages(...)The
difference between the classes is zero -- all behavior in ActionErrors was pushed up into ActionMessages and all behavior in ActionError was pushed up into ActionMessage. This was done in the attempt to clearly signal that these classes can be used to pass any kind of messages from the controller to the view -- errors being only one kind of message.
The difference between saveErrors(...) and saveMessages(...) is simply the attribute name under which the ActionMessages object is stored, providing two convenient default locations for storing controller messages for use by the view. If you look more closely at the html:errors and html:messages tags, you can actually use them to get an ActionMessages object from any arbitrary attribute name in any scope.
The difference between html:errors and html:messages is purely in syntax and model -- both tags *default* to look for an ActionMessages object under Globals.ERROR_KEY despite the difference in names.html:messages provides more flexibility at the cost of more typing
World of tricky Core Java Q and A Covering Object Oriented Analysis and Design, JVM Internals,Java Language Fundamentals,Datatypes,Keywords,Operators and Assignments,Identifies,Declarations and Modifiers, Conversion,Casting and Promotion, Flow control,Assertions, Exception Handling and Garbage Collection,Objects and Classes), Basic Packages and their classes,JDBC,JFC Swing,Java Server Pages (JSP), Servlets,EJB,JMS,JNDI etc and Open source technologies like Struts,Hibernate,Spring etc
Search This Blog
Monday, June 30, 2008
What are the differences between ActionErrors and ActionMessage?/What are the differences between Action.saveErrors(...) and Action.saveMessages(...)?
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment