打印请求Java Servlet上的调试信息

时间:2011-07-14 13:16:26

标签: java python django java-ee servlets

在进行Django / Python Web开发以完全检查这样的HTTP请求时,我发现非常有用

logger = logging.getLogger(__name__)
def index(request):
    logger.info(request)

Java Servlet有类似之处吗?

public void doGet(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
    // debugInfo should print something similar to what you get in DJANGO
    debugInfo(request);
}

1 个答案:

答案 0 :(得分:2)

由于我没有得到答案,I wrote a little helper class来帮助我解决这个问题。希望其他人发现它有趣且有用。