I’m new with java and tomcat, so, excuse me if it’s silly.
I would like to send commands (from the console) to a servlet that is already running on tomcat. The webapp will run the command in the tomcat context and return the appropiate answer.
i.e:
$ consoleApp status
running
Is it possible?, if yes, how?
thanks in advance.
You can make HTTP GET (or POST) requests to your servlet from the command line using tools like
curlorwgetand then process the servlet’s response. Advantage: If properly set up, you can run those commands also from a remote location.