ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Prins <mark.pr...@caris.nl>
Subject RE: invoking ant from jsp on win2k
Date Fri, 13 Sep 2002 15:01:39 GMT
ther was a thread on the tomcat list this week about running batch files
from a JSP or servlet... something to do with environment vars/space... I
think you have to explicitly call java.lang.Runtime.getRuntime().exec or
something to execute
check their list archive 

Mark


> -----Original Message-----
> From: Stefan Lipp [mailto:s.lipp@tallence.com]
> Sent: Friday, September 13, 2002 4:08 PM
> To: ant-user@jakarta.apache.org
> Subject: invoking ant from jsp on win2k
> 
> 
> sorry for another post, but all previous solutions mentioned 
> didn't work.
> 
> My case plain spoken:
> Used API in jsp and tried to fire up ant with given path to build-file
> which works all in a dos-box:
> <%@ page import="org.apache.tools.ant.Project"%>
> <%@ page import="org.apache.tools.ant.taskdefs.ExecTask"%>
> <%@ page import="org.apache.tools.ant.types.Commandline"%>
> <html>
> <head><title>invoke_ant</title></head>
> <body>
> <%
>     Project project = new Project();
>     ExecTask exec = new ExecTask();
>     exec.setProject(project);
>     exec.setExecutable("ant.bat");
>     Commandline.Argument arg = exec.createArg();
>     arg.setLine("-buildfile
>     e:/jakarta-tomcat-3.2.3/webapps/vignette_dev/build.xml"); 
>    exec.execute();
> 
> %>
> </body>
> </html>
> 
> tomcat error:
> 
> javax.servlet.ServletException: Execute failed: java.io.IOException:
> CreateProcess: ant.bat -buildfile
> e:/jakarta-tomcat-3.2.3/webapps/vignette_dev/build.xml error=2
> What went wrong? Is it that f...ing windows? Does sombody has 
> a solution?
> 
> thx
> 
> Stefan s.lipp@tallence.com
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:ant-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: 
> <mailto:ant-user-help@jakarta.apache.org>
> 

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