aspose file tools*
The moose likes Linux / UNIX and the fly likes how to invoke a shell script from a html form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "how to invoke a shell script from a html form" Watch "how to invoke a shell script from a html form" New topic
Author

how to invoke a shell script from a html form

Rishi Singh
Ranch Hand

Joined: Dec 09, 2000
Posts: 321
I have a reqirement in my project where I need to invoke a shell script from a html form and then forward this to a java application.The java application will validate the same by comparing it to the form data with entries in an file.Accordingly it will write to another file,the output has to be read by the shell script which activated the java application and dispaly it to the browser as a html page.
Please help me with the same and if supported by a code example it would be good.Calling all the Unix gurus...
jasonkosowan
Greenhorn

Joined: Sep 07, 2001
Posts: 25
My advice here would be to be VERY careful. There are MASSIVE problems with running a shell script based upon user input, ESPECIALLY while running from an anonymous external interface. (You can, literally, get hacked in seconds to minutes).
Why not, instead, use a servlet to accept the user input and do everything in the servlet instead of doing some sort of shell/java program combination?
Just my $0.02.
Abhishek Mhptr
Ranch Hand

Joined: Aug 09, 2009
Posts: 33
i am sorry as i am reopening the topic after a long interval.

In my shell script, i am going to stop the jBoss server.
can anyone please help me out in calling the shell script from the JSP to stop the JBOSS??

Thanks in advance.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16065
    
  21

http://faq.javaranch.com/java/DontWakeTheZombies

As I recall, there's an administration web page in JBoss that can shut down the JBoss server directly.


Customer surveys are for companies who didn't pay proper attention to begin with.
Abhishek Mhptr
Ranch Hand

Joined: Aug 09, 2009
Posts: 33
thank you so much for the reply tim..

i am sorry as i reopened the thread.

Actually i have a JSP in my UserInterface where i get and post data from database.
i need to give an option(tab or button) for the client to stop the server form the JSP.

please help me out in resolving the issue.

Thanks in advance.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to invoke a shell script from a html form