You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently (as of Spring Framework API 2.5) a reader of the RedirectView JavaDoc is lead to believe that "... by default exposing all model attributes as HTTP query parameters."
I read that to mean that all values in the passed model regardless of its object type are added as query parameters. HOWEVER, is is not the case. A user of the RedirectView has to also read the JavaDoc for the protected method, isEligibleProperty(String key, Object value), which states:
"...
The default implementation considers Strings and primitives as eligible, and also arrays and Collections/Iterables with corresponding elements.
..."
to figure out that no, not all attributes are added, only Strings and primitives are added as query parameters. It might be inappropriate to force a reader to read a protected method's JavaDoc to figure out important behavior of a class.
It would be nice if the main JavaDoc of the class clearly states that NOT ALL model attributes are added as query parameters, but only model attributes that are: Strings, primitive, and primitive wrappers.
Nathan Hook opened SPR-5910 and commented
http://static.springsource.org/spring/docs/2.5.x/api/org/springframework/web/servlet/view/RedirectView.html
Currently (as of Spring Framework API 2.5) a reader of the RedirectView JavaDoc is lead to believe that "... by default exposing all model attributes as HTTP query parameters."
I read that to mean that all values in the passed model regardless of its object type are added as query parameters. HOWEVER, is is not the case. A user of the RedirectView has to also read the JavaDoc for the protected method, isEligibleProperty(String key, Object value), which states:
"...
The default implementation considers Strings and primitives as eligible, and also arrays and Collections/Iterables with corresponding elements.
..."
to figure out that no, not all attributes are added, only Strings and primitives are added as query parameters. It might be inappropriate to force a reader to read a protected method's JavaDoc to figure out important behavior of a class.
It would be nice if the main JavaDoc of the class clearly states that NOT ALL model attributes are added as query parameters, but only model attributes that are: Strings, primitive, and primitive wrappers.
Thank you for your time.
Affects: 2.5.5
Referenced from: commits 501a1ea
The text was updated successfully, but these errors were encountered: