In Eclipse Java EE servlet does not output to console

后端 未结 2 1924
Happy的楠姐
Happy的楠姐 2021-01-14 18:03

I have a simple servlet that creates HTML with PrintWriter and writes to console via System.out.prinln() in the same doGet() method.

2条回答
  •  终归单人心
    2021-01-14 18:27

    You will find the System.out.println outputs in your web container logs i.e in GalssFish logs.

    Eclipse prints the sysout in its own console only for standalone applications and not for web applications. The reason is that, web applications are deployed in web containers and are run under those containers. Eclipse just helps that process of deploying the applicaitons but it does not deploy the webapps within it. Hence you will find the logs in the web container i.e glassfish.

提交回复
热议问题