Wednesday, October 22, 2008

Adding Apache Tomcat Server 5.5 to NetBeans IDE 6.1

Since few days I was thinking of writing some Java servlets with NetBeans IDE. I downloaded and installed NetBeans IDE 6.1. I was about to write my first servlet, but I came to know that Apache Tomcat server was no more bundled with NetBeans 6.1 and that I have to add it separately as an external server, which was a little bit irritating news but with no other options I have to add it.
I then downloaded the 5.5 version of Apache Tomcat. To add as an external server I was supposed to download the zipped version of the server rather then the windows installer. I downloaded the server from the Apache site http://tomcat.apache.org/download-55.cgi and then unzipped in c:\ in my hard drive.
Now, I first have to create a servlet project. I opened the NetBeans IDE. Clicked on File--> New Project. I choose the Web Application project.
After giving the name and location of the project when I clicked on the drop down button to see the server list I was able to see only the GlasFishV2 Server.

So, now at this point I clicked on the add button and showed the path to the Apache Tomcate server that I had unzipped early (in c:\).

To successfully add the server I have to make some changes on the configuration of the server. Mainly add an user. So while adding an user there is an option to create an user (a checkbox), I checked on that which created me an user. For more information please follow this wiki link http://wiki.netbeans.org/AddExternalTomcat
After successful addition of the server it did showed up in the dropdown for the server list.

I continued clicking on next and finally finish. I didn't selected any frameworks because I was going to create a generic servlet. Finally I clicked finished and everything was setup and I was ready to write my first servlet with NetBeans.

thanks