Common validation logic (from MVC newbie)

Discussion in 'Java' started by Re_endian_miss@yahoo.com, Apr 14, 2005.

  1. Guest

    I have some validation logic that I was hoping to write in a single
    place and then use it whenever needed, in any layer of my system. I
    could write it in java and use it anywhere on the server side, which is
    great. But what could I do to also access this SAME logic ON the
    client, i.e. without making a round trip to the server? My client uses
    JSPs/Struts... Do I have to "port" my validation code to Javascript
    just so I can run it on the client?

    Thanks in advance for any advice.
    , Apr 14, 2005
    #1
    1. Advertising

  2. Ryan Dillon Guest

    Yes. Without making a round trip to the server there is really no way
    to avoid replicating the validation in JavaScript. You could do some
    funky stuff with hidden frames (and even funkier stuff that Google
    seems to use) to prevent the page from actually refreshing, and still
    do the validation server side. But probably it would be easiest to just
    do it in JavaScript.

    --
    Ryan Dillon
    Code Canvas Technologies
    RapidJ - Rapid Java Web Development
    http://www.codecanvas.com.au/rapidj/
    Ryan Dillon, Apr 15, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. rmn190
    Replies:
    2
    Views:
    2,352
    Arne Vajhøj
    Jan 10, 2008
  2. Denny
    Replies:
    1
    Views:
    773
  3. Paulo
    Replies:
    3
    Views:
    475
    Peter Bromberg [C# MVP]
    Dec 4, 2008
  4. Crazy Cat
    Replies:
    1
    Views:
    682
    schepp
    Sep 3, 2009
  5. John Reye
    Replies:
    28
    Views:
    1,362
    Tim Rentsch
    May 8, 2012
Loading...

Share This Page