scwcd的考试,测试代码,如果希望参加此类考试将非常的有帮助
源代码在线查看: servleta.java
package scwcd.lab02;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class ServletA extends HttpServlet {
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("");
out.println("This is generated by ServletA!");
out.println("");
String path = "/servlet/exercise.ch02.ServletB";
RequestDispatcher rd = request.getRequestDispatcher(path);
rd.include(request, response);
out.println("");
out.println("Returned from ServletB.");
out.println("");
}
}