hi i have two sevlets. The request always comes to first servlet with one parameter. I would like to send the request to another servlet depends on the parameter value.
can some one help on this. how we can send the request from one sevlet to another?
You could either do a client-side response.sendRedirect or a server-side RequestDispatcher.forward (or include). The latter will preserve request information and attributes (which are lost when doing the former).
Let's say that you have a JSP page that sends a String conatins the name of the servlet to go to. Your first serlvet receives this request, and it can have this code to decide the next servlet to go:
It really goes without saying, but silently ignoring exceptions is of course something you should almost never do, and definitely not here. [ January 19, 2008: Message edited by: Ulf Dittmer ]