日期:2014-05-17 浏览次数:20635 次
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class Test extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//System.out.println("a");
//return null;
test(request,response);
}
public String test(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{
response.setContentType("text/html; charset=gb2312");
ServletContext sc = getServletContext();
RequestDispatcher rd = null;
rd=sc.getRequestDispatcher("/index.jsp");
rd.forward(request,response);
return null;
}
}