Depending on what kind of validation you do, you may be able to do
it within the page itself using JavaScript.  When the user clicks the
Submit button, check that required fields have been filled in, that
numeric fields contain numbers, etc.  If validation passes, submit to a
servlet, otherwise throw up an alert box telling the user what's wrong.

     Another option is to do the validation in the servlet the form is
submitted to, and if things don't meet your requirements, submit the
values that were passed to the validation servlet back to the form and
have the form populate itself with these values.  Include a value such
as errorMessage which, if not null, causes that form to display an alert
box containing the message.


Russell Montgomery
Digital Renaissance


> -----Original Message-----
> From: R.Ramaprabhu [SMTP:[EMAIL PROTECTED]]
> Sent: Thursday, March 04, 1999 2:59 AM
> To:   [EMAIL PROTECTED]
> Subject:      Retaining current page after post?
>
> Hi Guys,
>
> Is there any way to retain the current HTML page even after the form
> is submitted to servlet.
>
> To be more Clear if I am working on a form elements of Page A and
> after some data entry it is posted to a servlet .if
> there is error in the data entered (found after a validation against
> the DB)  I want a error message to be shown over Page A itself, other
> wise show page B.
>
> So is there any way to retain Page A till such validations are made.
>
>

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to