Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.help > #1640

Re: Validating form inputs?

From Roedy Green <see_website@mindprod.com.invalid>
Newsgroups comp.lang.java.help
Subject Re: Validating form inputs?
Date 2012-03-20 14:28 -0700
Organization Canadian Mind Products
Message-ID <cdthm7h8ouvn55aoeah597mjjse0j7mrkh@4ax.com> (permalink)
References <ed7f31e9-8a19-46c7-9a7c-ad8aabfb9599@x10g2000pbi.googlegroups.com>

Show all headers | View raw


On Tue, 20 Mar 2012 11:16:36 -0700 (PDT), Davej <galt_57@hotmail.com>
wrote, quoted or indirectly quoted someone who said :

>I have been thinking about the way I have been validating form inputs
>in the servelet and wonder if I would be much better off using class
>methods to verify these inputs?
>
>Consider that I am almost always gathering the inputs to instantiate
>one or more objects, but I gather and validate -- and then
>instantiate. Maybe I should instantiate an empty object and then use
>class methods to validate the inputs?
>
>Thanks
It is rather rude to your user not to tell him he has made an error
until several seconds after he has keyed an entire page.  This is
almost as bad as 1960s batch processing. Even 1970s, 3270 terminals or
keypunches could tell you on a field by field or keystroke by
keystroke basis about many errors.

There are basically to ways to fix that.  Use an Applet on the client
or use Ajax. Both have serious drawbacks.

What is EXTREMELY rude is to erase some of his fields or even all of
them if he makes an error.

-- 
Roedy Green Canadian Mind Products
http://mindprod.com
It is almost impossible to keep things in synch manually. Instead: 
-Keep each fact in only one central database (not necessarily SQL),
and access it as needed. Since there is only one copy of each fact, 
there is nothing to get out of synch.
-Use some automated tool so that if you change a fact is one place,
it automatically updates the others.
-Write a sanity checker you run periodically to ensure all is consistent. 
This is the strategy compilers use.
-Document the procedures needed to keep all in synch if you change 
something and rigidly and mechanically follow them.

Back to comp.lang.java.help | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Validating form inputs? Davej <galt_57@hotmail.com> - 2012-03-20 11:16 -0700
  Re: Validating form inputs? Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-03-20 12:08 -0700
    Re: Validating form inputs? Lew <lewbloch@gmail.com> - 2012-03-20 12:50 -0700
      Re: Validating form inputs? markspace <-@.> - 2012-03-21 09:24 -0700
      Re: Validating form inputs? Davej <galt_57@hotmail.com> - 2012-03-21 12:02 -0700
        Re: Validating form inputs? Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-03-21 12:59 -0700
        Re: Validating form inputs? Lew <lewbloch@gmail.com> - 2012-03-21 13:37 -0700
    Re: Validating form inputs? Davej <galt_57@hotmail.com> - 2012-03-20 12:56 -0700
      Re: Validating form inputs? Lew <lewbloch@gmail.com> - 2012-03-20 13:58 -0700
      Re: Validating form inputs? markspace <-@.> - 2012-03-21 09:30 -0700
  Re: Validating form inputs? Roedy Green <see_website@mindprod.com.invalid> - 2012-03-20 14:28 -0700
    Re: Validating form inputs? Gene Wirchenko <genew@ocis.net> - 2012-03-20 19:16 -0700
      Re: Validating form inputs? Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-03-21 17:41 -0300
        Re: Validating form inputs? Gene Wirchenko <genew@ocis.net> - 2012-03-21 14:46 -0700
          Re: Validating form inputs? Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-03-21 19:54 -0300
        Re: Validating form inputs? Roedy Green <see_website@mindprod.com.invalid> - 2012-03-22 10:34 -0700
      Re: Validating form inputs? Lew <lewbloch@gmail.com> - 2012-03-21 14:56 -0700
        Re: Validating form inputs? Gene Wirchenko <genew@ocis.net> - 2012-03-21 19:09 -0700
          Re: Validating form inputs? Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-03-22 08:36 -0700
            Re: Validating form inputs? Gene Wirchenko <genew@ocis.net> - 2012-03-22 09:40 -0700

csiph-web