struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Akshay Ahooja" <akshayaho...@gmail.com>
Subject Batch files from JSP
Date Tue, 01 Aug 2006 18:05:13 GMT
Hi,

This is not entirely a struts question, but how would I execute a batch from
on the server from a jsp?

If the .bat is in the same file as the jsp calling it.


I tried

    Runtime rt = Runtime.getRuntime();

    Process pr= rt.exec("db.bat");

But it gives errors.

java.io.IOException: CreateProcess: db.bat error=2
	java.lang.ProcessImpl.create(Native Method)
	java.lang.ProcessImpl.<init>(ProcessImpl.java:81)
	java.lang.ProcessImpl.start(ProcessImpl.java:30)
	java.lang.ProcessBuilder.start(ProcessBuilder.java:451)
	java.lang.Runtime.exec(Runtime.java:591)
	java.lang.Runtime.exec(Runtime.java:429)
	java.lang.Runtime.exec(Runtime.java:326)
	org.apache.jsp.batch_jsp._jspService(batch_jsp.java:59)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


Any help would be great,

Thanks,

Akshay

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message