Announcement Announcement Module
Collapse
No announcement yet.
Reuse Spring Validator for web sevices Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Reuse Spring Validator for web sevices

    Hi,
    As I understand that Spring Validation framework can be used in any type of application either web based or java or any class which implements a method for web services. How can we reuse a Validator which is bound to a controller which extends from SimpleFormController. This Validator validates fields from a web form and reject for example when a field is empty.
    ValidationUtils.rejectIfEmptyOrWhitespace(e, "homeAddress.streetNumber", "err.field.obligation");
    This means that the error is bound to the field name of the form. I would like to avoid to re-implement the validation for a web services via ServletEndpointSupport of Spring. How is it possible? Please give some explainations.
    Thank you in advance.
    Tvan

  • #2
    XML/MVC Validator

    I have exactly the same question - has anyone done something like this yet ?

    Basically our application accepts amendment requests. These are entered on a browser form and validated using MVC. Valid requests are committed to the system. We now want to allow amendment requests in XML format. What do we need to change to the validators and updaters so that they can also handle requests that originate in XML format (we have already translated the XML into a JavaBean using Castor).

    Any tips would be most welcome.

    Martin

    Comment


    • #3
      I don't think it will be supported using the JAX-RPC ServletEndpoint functionality. However, I think it would be quite easy to add support for Spring Validators to Spring-WS, in an EndpointInterceptor. Please add a JIRA issue if you want this.

      Comment


      • #4
        Sws-81

        SWS-81 created. Thanks for looking into this. Martin.

        Comment

        Working...
        X