在Java Servlet中打印请求调试信息
在做Django/Python网页开发的时候,我发现完全检查一个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);
}