In Eclipse Java EE servlet does not output to console

后端 未结 2 1923
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.

    0 讨论(0)
  • 2021-01-14 18:40

    How to Log out to console: Right click on your glassfish and go to View Log File enter image description here Make sure the console setting is directed at your server.log file: enter image description here

    0 讨论(0)
提交回复
热议问题