servlets: how to notify of failed validation

D

dave

Here's what i want to do in most efficient way possible.

I have 1> an html form that asks for an integer. 2> If not an integer, I
want to create, like in a lot of commercial websites, a refresh of that same
page with red letters saying "Sorry this number is not an integer please try
again". Instead of creating like 3 servlets, how do i do this with one?
 
B

Bryce

Here's what i want to do in most efficient way possible.

I have 1> an html form that asks for an integer. 2> If not an integer, I
want to create, like in a lot of commercial websites, a refresh of that same
page with red letters saying "Sorry this number is not an integer please try
again". Instead of creating like 3 servlets, how do i do this with one?

JSP

Have JSP look for ErrorList or something in session.

If not there, don't do anything.

If there, make red letters.

In servlet, if not integer, create ErrorList, put in session, redirect
back to JSP.

or... Use Struts, which has most of this built in.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,434
Messages
2,571,685
Members
48,796
Latest member
Greg L.

Latest Threads

Top