Results 1 to 6 of 6

Thread: Spring MVC 3 Error suggestions

  1. #1

    Default Spring MVC 3 Error suggestions

    I am currently using spring's form taglib and am displaying errors when received back from the server and it works great:

    Code:
    <form:errors path="*"/>
    What does everyone do for ajax errors? Do you just plug them into about the same spot, use error codes, or ...?

    Thanks

  2. #2

    Default

    echo echo echo echo

  3. #3
    Join Date
    Mar 2010
    Location
    Boston, MA
    Posts
    316

    Default

    When you say AJAX errors..are you referring to async calls made to the server? If so Shouldn't they be handled/processed in the same way your other validation calls are happening?

  4. #4

    Default

    yes, asynch. I'm unsure how to plug them into springs taglibs. When I receive them back from the server-side I get them in JSON format.

    Currently what I do is have a set of errors that exist in separate divs (that are invisible) and have a error code associated with each. When i receive an error from the server I just make the div with the proper error code appear. That is just for JSON, for everything else I use spring's form:errors taglib.

    But I was interested in how other people handled it and if there was a cleaner way?

  5. #5
    Join Date
    Mar 2010
    Location
    Boston, MA
    Posts
    316

    Default

    In my case all calls , sync and async are validated by the same validators and are accessed on the jsp using form:errors (i don't use a separate response mechanism for async calls but rather use the same mvc model object paradigm to propagate errors). I dont use divs etc to show hide dynamically but rather use tiles+Spring JS/AJAX to reload specific parts of the page (in the case of a async all). This way all my requests/response are handled in the same way and the error validation is also central.

  6. #6

    Default

    ah yeah, I forgot about that. I didn't mention I was on Portlet MVC, but I forgot that there are parts (like the marshaller) the portlet code can't use.

    Interesting on the Spring JS, haven't checked that out. Thanks!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •