In Query servlet, after you detemine which servlet to call, you use
try {
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("Relative_Servlet_URL_AS_STRING");
dispatcher.forward(ServletRequest request,ServletResponse response)
}
catch (java.io.IOException e) {
// error handle..
}
The above code forward ALL request and response stuffs to the new servlet.
About your second question, you need to pack the contact manager, contact list and all other non-servlet class INTO a .jar file. And then deploy at the web server as a javabean.
Then in the servlet, you will import the class using the import statement. Then you can construct contact or contact list object you mentioned above inside your servlet to process the reading and searching of the txt file.
try {
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("Relative_Servlet_URL_AS_STRING");
dispatcher.forward(ServletRequest request,ServletResponse response)
}
catch (java.io.IOException e) {
// error handle..
}
The above code forward ALL request and response stuffs to the new servlet.
About your second question, you need to pack the contact manager, contact list and all other non-servlet class INTO a .jar file. And then deploy at the web server as a javabean.
Then in the servlet, you will import the class using the import statement. Then you can construct contact or contact list object you mentioned above inside your servlet to process the reading and searching of the txt file.