am writing a servlet which takes an ID as a parameter. am trying to check if the ID is not null or empty before i do anything with it.
the problem is when the "custID" is not passed as a parameter to the servlet it displays the error.jsp page and then continues on to search the db !! i thought after dispatching the request it would exit/stop rather than continuing on to process the rest of the lines in doPost() ??
Servlets are not magic -- they follow the same rules as any other Java class. So after the call to forward(), control returns to the servlet which continues to execute. Restructure the code accordingly.