Tuesday Apr 05, 2005

Easy Access to Tomcat Users File from NetBeans IDE

Whenever I access the Tomcat Manager for the first time in a session, this little dialog box appears:

For details on this from Tomcat's site, click here.

What then happens is that I've got to dig into the IDE's user directory to find a file called tomcat-users.xml, which includes a user called "ide" (which is assigned the role of "manager") together with an IDE-generated password. The digging is a bit frustrating, so I'm using this Ant script instead:

<target name="ShowTomcatUsers">
  <property name="file" location="my-user-dir\\jakarta-tomcat-5.5.7_base\\conf\\tomcat-users.xml"/>
  <exec executable="c:\\Program Files\\Vim\\vim63\\gvim.exe">
     <arg value="${file}"/>
  </exec>
</target>

I've just added it to the build.xml file, together with a shortcut so that whenever I need it I can just click a button or a menu item in the IDE to display the file:

Just one of the many benefits of Ant integration in the IDE...

NB: Because the authorization dialog box is modal, I need to click out of it and then use the shortcut to access the Tomcat users file. So I need to work out some way of calling the ShowTomcatUsers target automatically whenever the Tomcat Manager needs to be authorized. It could be called from the Run target, except that I haven't worked out yet how to test whether the Tomcat Manager needs a password. Only in that instance would the file need to be called.

About

Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.

Search

Archives
« April 2005 »
SunMonTueWedThuFriSat
     
1
2
8
9
10
14
16
18
22
23
29
       
Today