Here's what you could do:
Use a jsp for your initial form. When the user submits the form, if the input is
invalid, set a session var to indicate the particular error condition, and then
redirect (using Response.sendRedirect()) to the form.jsp itself. Now use the
value of the session vars set in the servlet and javascript alerts to inform the
user of what was wrong.

Geeta

[EMAIL PROTECTED] wrote:

> Hi all,
>
> Scenario:
>         1) User  fills up form.
>         2) Servlet accesses the database thru JDBC and validates the input
> fields.
>         3) Several fields are invalid and servlet wants to inform user about
> this.
>
> What do you think is the best solution for this?
>
> I do not seem to like displaying error message(s) in a separate page. Maybe,
> just in JavaScript -like alert() or even in the browser status line. If I use
> JavaScript, how can I make the servlet cause JavaScript to show the messages?
> Is there a better alternative?
>
> Thanks in advance.
>
> Dingdong
>
> ___________________________________________________________________________
> 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

___________________________________________________________________________
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