开发者

Printing Request debug information on a Java Servlet

I find it extremely useful when doing Django/Python web development to fully inspect a HTTP request like this:

logger = logging.getLogger(__nam开发者_如何学Pythone__)
def index(request):
    logger.info(request)

Is there something similar for a 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);
}


Since I got no answers, I wrote a little helper class to help me with this issue. Hope someone else finds it interesting and useful.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜