w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Start thread on standalone application from Servlet

What is the best way to invoke a main program from a servlet with arguments. I was thinking of using Runtime object's exec() method to call .bat file. Anything better than this?

Instead of this, IMO, you create a thread class in your web application and execute the webservice call within it in parallel

Also, if you are using Servlet3 API, then a new Async support introduced by the API spec may help

© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.