达内LOGO和北京达内网址达内科技培训项目:Java培训 3G培训 Android培训 软件测试培训北京达内服务电话
java培训
Ajax代理的Java Servlet的实现

  01.import java.io.IOException;

  02.import java.io.InputStream;

  03.import java.net.URL;

  04.

  05.import javax.servlet.ServletConfig;

  06.import javax.servlet.ServletException;

  07.import javax.servlet.ServletOutputStream;

  08.import javax.servlet.http.HttpServlet;

  09.import javax.servlet.http.HttpServletRequest;

  10.import javax.servlet.http.HttpServletResponse;

  11.

  12./**

  13. * Take any request and proxy it to the given REDIRECT_BASE.

  14. * For example, if this servlet lives at

  15. *

  16. * http://foo.com/forward

  17. *

  18. * and is inititialized with the REDIRECT_BASE

  19. *

  20. * http://bar.com/some/path

  21. *

  22. * then a GET request like

  23. *

  24. * http://foo.com/forward?quux=mumbley

  25. *

  26. * will return the results of a GET from

  27. *

  28. * http://bar.com/some/path?quux=mumbley

  29. *

  30. * This is not robust and generalized; it's simple and quick.

  31. *

 

本页标签: Java Servlet
客服系统