I use the bufferedreader in the servlet, in theory it should wait when I write something in the console, but it immediately returns null and responds

BufferedReader in = new BufferedReader (new InputStreamReader (System.in)); String strLine = in.readLine ();

StrLine returns null, what should be done to read from the console?

    1 answer 1

    So just you won't do it. The servlet container, most likely Tomcat, does not have its own stdin stream. The fact that in your understanding the console in the IDE is the interception of the Tomcat stdout output, and you can only write to it. But in order to be able to send something to the servlet from the keyboard, you can write a console application and access it via RMI