Look Inside

jeffrey815 (Smartiecat)
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.
2001-11-21 -04:00
This post has been archived. It cannot be replied.
Page address has been copied. To share, click to copy page address.
Share Online by QR Code

Back To Topic: 各位大虾,JAVA servlet紧急求救!

Back To Forum: HOME枫下论坛枫下论坛主坛工作学习IT技术讨论