• Post Reply Bookmark Topic Watch Topic
  • New Topic

To invoke a servlet from a unix shell script

 
NISHAR AHAMED
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I need to write a shell script that has to invoke a servlet or send a http request to servlet.
Any tips?
reply to nishar_ahamed@lycos.com
Thanks
Nishar
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
you can try to execute lynx <targeturl>.
This then starts a request to the servlet.
olli
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why not write a short program in Java? Look at the documentation for java.net.URL, URLConnection and HttpURLConnection. Of course there are also Perl tools to do this.
Bill
[ July 25, 2003: Message edited by: William Brogden ]
 
Philip Shanks
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
wget or cURL are probably the easiest solutions -- they are designed to do exactly what you describe. If you don't have either of these, and you don't have admin access to install one, you can probably find a statically linked binary to run local.
[ July 25, 2003: Message edited by: Philip Shanks ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!