hi,

| I want that when the validations are OK, a new browser window would be
| opened.
| BUT if there is some error the error message must be shown in the first
JSP
| and NOT open a new window.
|
| I'm trying to do this with a TARGET="_blank" at the FORM tag, but the
| redirection from the servlet is
| always shown in the new window.
|
| Is there any way to avoid opening the new window and make the redirection
of
| the servlet going to the first JSP???
|

there are two options you have (in my opinion), both make use of JavaScript.
1. before you call the servlet make the validation you need on the client
side. that way you can decide if a new window shall be opened.
2. you call the servlet to validate the values of the form, in the page that
is returned by the servlet you have a field indicating whether the
validation found errors or not. a script uses this field to decide whether
the opened window should be closed (and in the other window the error should
be displayed) or everything is valid and the window may remain open.

i'd prefer #2 because validation is done on the server side (if js is
switched of client-side validation fails) and if js is disabled instead of
closing the window with a script you could provide a link in the pop-up
window indicating that a invalid value was entered in the form and pointing
to the original window. if this link if clicked the main window displays an
error message to the user.

| thanks in advance
|   Beatriz

Hope this helps!

-mw

___________________________________________________________________________
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