how to see console output in netbeans ide 6.8

coder25 picture coder25 · Jun 15, 2011 · Viewed 10.9k times · Source

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

Answer

Chathuranga Withana picture Chathuranga Withana · Jun 15, 2011

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....