• Post Reply Bookmark Topic Watch Topic
  • New Topic

Executing Batch File from JSP file

 
Sajeendra Prasad
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Can anybody provide details about - How to run a batch file which resides in a Webserver thro' a JSP file.

1. Have access to the webserver a particular port.
2. So need to use only HTTP protocol.
3. I need to run a batch file that is residing in the web folder of the weserver.
4. I assume I can use only JSP and I can put Java code in JSP file.

Thanks
Sajeendra
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Sajeendra Prasad:
Hi All,

Can anybody provide details about - How to run a batch file which resides in a Webserver thro' a JSP file.

Runtime.exec() allows you to commands as a separate process.
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Runtime.html

1. Have access to the webserver a particular port.
You configure the port at the container level. Read your server's documentation.
2. So need to use only HTTP protocol.
Yes, you can call it from a browser.
3. I need to run a batch file that is residing in the web folder of the weserver.
Put it where ever you like. Best if you can make the location a configurable
init param.
4. I assume I can use only JSP and I can put Java code in JSP file.
You could do it from a servlet as well, but yes you can do it from a
Java scriptlet in a JSP page.

Thanks
Sajeendra
[ January 07, 2005: Message edited by: Ben Souther ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!