Urgent : Executing a batch file in a JSP file
843836Sep 13 2004 — edited Nov 15 2007Hi;
I need help in executing a batch file within a jsp page, ive the following codes but it doesnt seem to work...
These are the codes :
<%@ page import="java.util.*,java.io.*,java.net.*" %>
<%@ page import="java.sql.*" %>
<%
Process p = Runtime.getRuntime().exec("Ratio.bat");
p.waitFor();
int i = p.exitValue();
%>
The following is the error :
ype Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
java.io.IOException: CreateProcess: Ratio.bat error=2
java.lang.Win32Process.create(Native Method)
java.lang.Win32Process.<init>(Win32Process.java:63)
java.lang.Runtime.execInternal(Native Method)
java.lang.Runtime.exec(Runtime.java:550)
java.lang.Runtime.exec(Runtime.java:416)
java.lang.Runtime.exec(Runtime.java:358)
java.lang.Runtime.exec(Runtime.java:322)
org.apache.jsp.invRatio_jsp._jspService(invRatio_jsp.java:52)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
Anyone can tell me why it doesnt work ?... Thanks