views:

102

answers:

1

Hello all. Let me start out by saying that I am new to Java/JSP web development, so I may have totally missed something simple. If so, I apologize for it in advance.

Basically, what I am trying to do is setup local development sites in Tomcat as a separate Virtual Host, similiar to how I have setup Apache Virtual Hosts in the past. I hate accessing a local dev site using http://localhost:8080/mywebapp. In Tomcat, I have added a new Host element in the server.xml and modified my Windows hosts file so that now I can access my site with the url http://mywebapp:8080, which is exactly what I want. Everything works flawless to this point.

The problem starts when I try to use a NetBeans 6.8 JSP project to work on the site. NetBeans is dead set on using http://localhost:8080/mywebapp no matter what I do when I debug or run the site through it. I cannot find anywhere to change what url the site should use in any of the Properties menus. Does anyone know how to change this or anything I may have missed along the way? When I set up PHP projects in NetBeans it allows me to enter the url I want to run the site from and to change it through the project properties.

Again, JSP development and Tomcat are very new to me, but I am very anxious to get started making JSP sites after working with ASP.NET for the past few years. Thanks!

+1  A: 

I finally figured it out, well, I figured it out enough to work for me. To make Netbeans see the servers as I want, you have to create a new server in the Add Server dialog and give it a different path than the default Catalina base. Then, when setting up the project, set the context path to nothing and now the site will be run as http://localhost:8080 and not http://localhost:8080/xxxxx. While this isn't exactly what I wanted, it does work for me for now.

Jason Watkins