You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Hernandez, Mariano" <M....@TriCorInd.com> on 2005/08/03 01:28:08 UTC

Reasons to switch from 1.1 to 1.2

Well, here it is anyway. Anyone have any comments?

 

Validation (client and server side)

*        The Struts Validator now supports a ValidWhen rule, so that one
validation can be dependant on another. **

*        IntRange now checks select-one and radio fields. Example: This
allows populating combo boxes with valid choices plus one additional choice
with a caption something like "Choose one" and a value 0f "-1". Then when
the user attempts to submit the form, you can look for the value of "-1" and
advise if nothing was selected. 

*        You can now force the clientside Javascript validation to check all
constraints, instead of stopping at the first error. By setting a new
property, stopOnFirstError, on the Validator PlugIn to false.

*        The "required" validation can now handle checkboxes,
radio,select-one, and select-multiple field types. See the updated Validator
example application to see these new features in action. 

*        A standard validateUrl rule lets you check if a property contains a
well-formed URL as well as optional variables to configure various aspects
of URL validation

*        A bug involving the use of multiple forms and client side
validation  has been fixed.

*        A test for null validator form inside "createDynamicJavascript" has
been moved so that those who use the tag to generate static javascript don't
get a JspException.

*        Parsing of integer values is corrected. 

*        The Validator PlugIn validates the validation XML file and errros
now throw an exception to loudly flag an error instead of trying to guess
what's wrong.

*        Deprecated classes have been removed and are now in Commons
Validator.

*        Now allows intRange validation of select-one and radio fields. In
some form combo boxes you might have the combo boxes populated with valid
choices plus one additional choice with a caption something like "Choose
one" and a value 0f "-1". Then when the user attempts to submit the form,
you can look for the value of "-1" and yell at them if they failed to pick
something.

*        Fixed a bug so that it when a form has indexed properties (EG
nested forms) all indexed fields are checked and does not stop on the first
failure.

Actions and Forms

*        A performance bottleneck in obtaining request processor in the
ActionServlet has been eliminated

*        The Action class and all its children have added getErrors,
getMessages, addErrors, and AddMessages methods, to better manage error
handling. 

*        Default and Cancel handlers have been added to DispatchAction and
LookupDispatchAction. 

*        A new DispatchAction, MappingDispatchAction, has been added. Unlike
DispatchAction, mapping characteristics may differ between the various
handlers, so you can combine actions in the same class that, for example,
differ in their use of forms or validation. Also, a request parameter, which
would be visible to the application user, is not required to enable
selection of the handler method.

*        DispatchAction, ForwardAction, IncludeAction, SwitchAction now
throw exceptions from execute() method instead of sending a failure response
to the client. This allows the exception handling mechanism to respond to
the error gracefully.

*        A DynaBean flavour ActionForm which doesn't need its properties to
be defined and provides Lazy List and Lazy Map behaviours.

*        It is now possible to either disable or make read only all fields
for a form using the new readonly and disabled attributes on the <html:form>
tag. 

*         

Tiles Classes and Tag library 

*        PutTag: Manage tag body content more carefully to ensure pooled
tags do not display old content with empty tiles. 

*        The Tiles tags are now avaiable through the Struts EL taglib, which
is based on JSTL

*        2003-09-07 - ImportAttributeTag,UseAttributeTag: Removing "final"
from class declaration, to allow class to be extended in "tiles-el" (or
other classes). 

*        2003-07-27 - xmlDefinition/XmlParser: Remove deprecated/non
functional digester logging method. 

*        2003-07-10 - TagUtils: Deprecated getProperty() because it provided
no value over calling PropertyUtils.getProperty() directly. 

*        2003-07-08 - TilesServlet,ActionComponentServlet: Formatted code,
removed deprecated constant. 

*        !!!!!!!!!!!!!!2003-07-04 - ActionController: Call Action.execute()
instead of perform().2003-07-07 - InsertTag: Fixed exception handling.
Instead of swallowing exceptions or printing the stack trace on the page,
the exceptions are logged and rethrown as JspException for the page error
handling mechanism to deal with. 

*        2003-07-07 - InsertTag: More code cleanup, removed deprecated
method, deprecated ROLE_DELIMITER because it is only used internally to this
class 

Miscellaneous 

*        Struts can now automatically highlight error fields using the new
errorKey, errorStyle, errorStyleClass and errorStyleId attributes on the
HTML Input Tags 

*        Wildcard mappings allow you to define a generic set of mappings
that can be used across all actions that follow a common workflow pattern
and naming convention. On numerous occasions people have complained on the
struts-user list that they have to write so many repetitive action mappings;
that all essentially implement the same workflow. A typical workflow might
be: 

1.      prepare the form for viewing 

2.      display the form on a JSP 

3.      submit the form to an action that saves the data 

4.      display a success page

Good developers will use common naming conventions that across-the-board so
it's easy for other developers to know what purpose the actions serve.
Wildcard mappings allow you to codify the common pattern and naming
convention.