File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes IDEs, Version Control and other tools and the fly likes How to use NetBeans for Servlet/JSP development Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Reply Bookmark "How to use NetBeans for Servlet/JSP development" Watch "How to use NetBeans for Servlet/JSP development" New topic
Author

How to use NetBeans for Servlet/JSP development

Mark Howard
Ranch Hand

Joined: Feb 14, 2001
Posts: 285
I am completely new in the Java IDE world, so forgive me if this question sounds a bit lame...
In an attempt to familiarise myself with a Java IDE I downloaded NetBeans from the web and am trying to test a Servet/JSP web app I'd created earlier using TextPad (while preparing for SCWCD).
I've configured the IDE as well as I can from the online Help documentation, and got as far as starting the internal Tomcat server, but then I get stuck. How do I actually run the servlets and JSP of my web app? Do I need to open a browser window and run from the address line, or do I initiate the servlets from within NetBeans somehow?
Any help much appreciated
Mark Howard
Ranch Hand

Joined: Feb 14, 2001
Posts: 285
Please ignore the plea for help in my previous post as I've discovered the problem I was experiencing.
It seems that when you execute a servlet from within NetBeans, the request path it uses excludes the web application context name.
Eg. If the web app context is called Test and the servlet is called MyTestServlet, NetBeans will open a browser with a request path of: http://localhost:8080/servlet/MyTestServlet (Note: no Test in the path)
When creating a servlet from scratch within NetBeans, it defines a servlet-mapping in the deployment descriptor to ensure that the servlet is found.
Sneaky. And confusing for newbies like me who are trying to use NetBeans on existing Servlet/JSP code without making any code or web.xml changes! (I suspect this may be configurable somewhere in NetBeans but I haven't come across it yet)
Still, I find NetBeans quite easy to use even though I have nothing else to compare it against other than TextPad.
 
IntelliJ Java IDE
 
subject: How to use NetBeans for Servlet/JSP development
 
Threads others viewed
sending image to the phone from the server
Netbeans 5.5 and Servlets
NetBeans 6 vs. JBoss Developer vs. Eclipse
How to use Servlets using Netbeans 6.7.1 and JBoss 5.1.0 GA
JSP Project Deployment
IntelliJ Java IDE