permaculture playing cards
The moose likes Tomcat and the fly likes Neat trick for Unix shell users.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Neat trick for Unix shell users.." Watch "Neat trick for Unix shell users.." New topic

Neat trick for Unix shell users..

Ben Souther

Joined: Dec 11, 2004
Posts: 13410

If you code for Tomcat as I do sans-IDE, you might find this tip useful.

Even with the "reloadable" attribute set to true, it is often necessary to manually reload an application (web.xml changes, context scope vars etc..) running in Tomcat.
The fastest way to do this (CPU wise) is with the Tomcat manager application.
The problem is that this involves having a browser open and on that page or else reaching for the mouse (a loathsome chore).

wget to the rescue!

Like most command line junkies I have a script that I use to set up my environment for each project (classpath etc..).

By creating an alias that calls wget (a command line tool for pulling HTTP content from cron scripts for mirroring websites), pointed to the manager app, I've made it easy to quickly reload the app I'm working on without leaving the window I'm in.

Here is the command:

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Sonny Gill
Ranch Hand

Joined: Feb 02, 2002
Posts: 1211

Good tip Ben, Thanks.

The future is here. It's just not evenly distributed yet. - William Gibson
Sonny Gill LinkedIn
I agree. Here's the link:
subject: Neat trick for Unix shell users..
It's not a secret anymore!