I have a small servlet-base application that searches a back-end
database. I want to port this application from a monolithic servlet
(with embedded HTML) into the "Model 2" approach described in the JSP
spec (using JSDK2.1 and JSP.92). Being very new to JSP, I have some
questions.
Imagine this user error situation. The user is presented with a HTML
form that allows them to enter a name to search for. Currently in my
servlet app, once the form is submitted, the servlet checks for
invalid input. If the input is invalid (ie. the search for field is
blank), I return the original search form with a descriptive error
message. This way, I don't want waste the user's time redirecting
their browser to another error page (and thus force them to click
return to the search form).
How can such an user interface be implemented in the Model 2 approach?
Could this work?
Make the original search form a JSP file that submits the form to a
search servlet. Upon discovering invalid input, the servlet would
create a "UserError" bean, set the "message" property and then send
it back to the search JSP. The JSP would contain some Java scripting
to detect the UserError bean and display the error.
DJ
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JSP-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".