Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to invoke a shell script from a html form

 
Rishi Singh
Ranch Hand
Posts: 321
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18157
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Abhishek Mhptr
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic