• Post Reply Bookmark Topic Watch Topic
  • New Topic

Calling servlet from shell script  RSS feed

 
Rajesh Kandhasamy
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Can anyone guide me how to invoke servlet from shell script,

Thanks in advance
 
Tim Holloway
Saloon Keeper
Posts: 18799
74
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Tim Holloway:
Servlets can't run as standalone apps, so somewhere you have to have a servlet container (web application server) running to host them.

To invoke a servlet from a shell script you need a scriptable web access program. One of the most popular of these is the "wget" program. Here's a simple example of how you'd use it to retrieve the HTML content of the Saloon front page into a local file:

wget http://www.javaranch.com

wget can do a lot of things, but for really sophisticated scripts there are facilities such as curl. Or you can write a standalone Java application that uses the URLConnection classes to talk to the web server.
[ June 27, 2007: Message edited by: Tim Holloway ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!