Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration of SpringMVC with Hibernate Validator [SPR-4528] #9205

Closed
spring-projects-issues opened this issue Mar 2, 2008 · 3 comments
Closed
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: duplicate A duplicate of another issue type: enhancement A general enhancement

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Mar 2, 2008

Ted Bergeron opened SPR-4528 and commented

Based on my article: http://www.triview.com/articles/hibernate/validator/canmeetyourneeds.html provide built in integration with hibernate validator.

This may be broken down into several issues:

  1. Extend JSP tag library to search for validation annotations via reflection. Render fields with css classes such as required, email, etc. Add maxlength attribute, etc.
  2. Native support to invoke the proper Hibernate ClassValidator and convert the InvalidValue array to a Spring Errors object.
  3. Extend JSP tags to render semantic html wrapper around form fields. Include div, label and field.
  4. Extend JSP tags to render with enhanced features, such as adding popup calendar for Date. Consider extracting info from assigned PropertyEditor.
  5. Add basic, included JavaScript validation support and/or integration with a major javascript framework such as prototype, jquery, ext, etc.

Attachments:

Issue Links:

2 votes, 3 watchers

@spring-projects-issues
Copy link
Collaborator Author

Ted Bergeron commented

Latest source code. Contains current tagfile implementations and most tagfiles reimplemented as taglibs that extend the Spring form taglibs. Contains ant build.xml that will build a jar suitable for use in projects.

@spring-projects-issues
Copy link
Collaborator Author

Ted Bergeron commented

Original source code and working example application from September 2006 article. (Same download as referenced by the posted article)

@spring-projects-issues
Copy link
Collaborator Author

Ted Bergeron commented

Two unrelated enhancements are available in the first attachment:

  1. A DateEditor that accepts seperate parsing and rendering DateFormats.

For example, in the USA users constantly want to enter dates short hand, or with a 4 digit year. I use:
public static final String RENDERING_DATE_FORMAT = "MM/dd/yyyy";
public static final String PARSING_DATE_FORMAT = "MM/dd/yy";

  1. Support for arbitrary String or Enum backed checkboxes. Spring will send "false" to a boolean or String for an unchecked checkbox. Yet when checked, users can send any String they want, not just "true". In many cases I have to provide a checkbox UI for an Enum of ENABLED, DISABLED, DELETED. Many clients require database deletes to be handled with this status. Users of screens can ENABLE or DISABLE, but never see the DELETED status records on these pages.
    (In the attachment, see processStringCheckboxes method of BaseFormController.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: duplicate A duplicate of another issue type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants