This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Using Servlets to run exec() method  RSS feed

 
Sreedhar Ka
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please let me know if it is possible to use the Runtime.exec() method in servlets. if yes then how ?if not then how do i execute a bat file in a servlet??


thanks
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's possible.
Run it like you would from any other Java code.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just remember that you have to provide for handling the output streams - the java.lang.Process JavaDocs are a good place to start.
Bill
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!