views:

46

answers:

4

We're designing a JEE web app (to run on tomcat)

It's intended to be a web interface for a command line program. Is there any framework/application that allows this?

i.e. JSP pages which will internally fire commands to a program installed on the same server as the Tomcat server.

The command line is a propietary non-Java program.

+3  A: 

You can use java.lang.Runtime and its exec(..) methods to start command-line programs.

Bozho
yes - aware of that one. was hoping if any web framework allows this or have to write JSP > servlet code to do this?
ktaylorjohn
@ktaylorjohn this is not web in nature, so I doubt there is a framework
Bozho
@ktaylorjohn, there is nothing special about invoking native programs in regards to JEE settings. Just do it in the usual fasion.
Thorbjørn Ravn Andersen
+1  A: 

You can make your own, its pretty simple,

capture command from jsp,And execute it on server using

Runtime.getRuntime().exec(commands);

and send back the response

org.life.java
A: 

I've found this article to be invaluable when using .exec

http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

It has quite a lot of good example code, and shows many of the pitfalls.

kskjon
+1  A: 

Be aware that your security manager will probably restrict the use of Runtime.exec() inside of your application server...

Guillaume
It looks like it can work with Tomcat though which is my target server. http://readlist.com/lists/tomcat.apache.org/users/1/5083.html
ktaylorjohn