Common validation logic (from MVC newbie)

R

Re_endian_miss

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.
 
R

Ryan Dillon

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Newbie from Scotland 1
Where To Put Validation Logic? 5
MVC 0
why MVC is not extensible ? 2
Logic 12
MVC/form validation? 0
MVC + RMI 3
Certificate validation 1

Members online

Forum statistics

Threads
473,756
Messages
2,569,533
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top