File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes validation and forward Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "validation and forward" Watch "validation and forward" New topic

validation and forward

Amitkumar Dhama
Ranch Hand

Joined: Feb 14, 2005
Posts: 56
HI all,
How will a controller servlet will deside to which servlet or jsp component it has to forward the request at run time in mvc archi. if possible give me some coding for that


How do we handle the validation of request.

thanking in advance....

SCJP 1.4, SCWCD 1.4, M.Tech(CSE)
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
You have to tell the controller where to dispatch to. This can be done via requestDispatcher. It can also be done via the web.xml configuration file.

As for validating the request, you can do it on the client side using javaScript, and also do it on the server side. It's a good idea to do it in both layers.

So much trouble in the world -- Bob Marley
Abhinit Saxena

Joined: Jan 10, 2006
Posts: 18
following code snipit can give you a basic idea of do the thing with forward

I agree. Here's the link:
subject: validation and forward
It's not a secret anymore!