how to see console output in netbeans ide 6.8

瘦欲@ 提交于 2019-12-22 11:17:03

问题


i have a servlet i want to see output on console,my servlet is running if i replace System.out.println with out.println

protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
    response.setContentType("text/html;charset=UTF-8");
    PrintWriter out = response.getWriter();
    try {

        out.println("<html>");
        out.println("<head>");
        out.println("<title>Servlet NewServlet</title>");  
        out.println("</head>");
        out.println("<body>");
        out.println("<h1>Servlet NewServlet at " + request.getContextPath () 
            + "  </h1>");
        System.out.println("exit");
        out.println("</body>");
        out.println("</html>");

    } finally { 
        out.close();
    }
}  

the exit is not getting displayed on console. can anyone tell me the reason


回答1:


I tried out your sample code, but its working well. And I used GlassFish as the server, so in the console it gives INFO: exit as the result. I think your "exit"text is not noticeable. Prefix your "exit" with some "*" marks and see....



来源:https://stackoverflow.com/questions/6355087/how-to-see-console-output-in-netbeans-ide-6-8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!