Venkat Venkat - 10 months ago 72
Java Question

How to run the servlet program in netbeans IDE?

I am new to java servlets. I learning from the basic. I have a simple servlet program, but i don't know how to run it.

import javax.servlet.*;
import javax.servlet.http.*;

public class HelloWorld extends HttpServlet
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException
PrintWriter out = response.getWriter();
out.println("Hello World");

How can run the above program in netbeans. I am using the netbeans6.8. Whats are the procedures which i have to follow?
Thanks in Advance.

Jon Jon
Answer Source

You need to make sure you've created a web application project in Netbeans, then you should be able to run your Servlet as part of it. This guide is for Netbeans 5 but the principles should be still the same: