How to see console output in netbeans ide 6.8

I have a servlet that I want to see on the console, my servlet works 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 output is not displayed on the console. can someone tell me the reason

+3
source share
1 answer

I tried your sample code, but it works well. And I used GlassFish as a server, so in the console it gives INFO: exitas a result. I think your text is "exit"not visible. Prefix "exit"with some "*"labels and see ....

+1
source

All Articles