what sachin mentioned is not correct, as i tried that but it was giving error. The error is " NOT a Java Source Folder."
Joined: Feb 11, 2008
I want to run a servlet program on Eclipse. Just tell me the procedure or what steps i have to follow.?
Joined: Mar 22, 2005
What Sachin says is correct; note that the post is about running servlets in Tomcat.
Eclipse is an IDE, not a servlet container - it can't run servlets directly. It may be possible that it starts a servlet container like Tomcat internally, but even then a certain directory structure must be adhered to.
I suggest you consult the Eclipse documentation (or help) on what it does to start a servlet container (assuming it can do that), and how you can deploy servlets into that.
You might also want to look through the archive of posts on this topic. You're not the first person to wonder how to do this. [ August 15, 2008: Message edited by: Ulf Dittmer ]
One more thing to add....If you are learning servlets then I would suggest you to run the servlet application separately in Tomcat server instead of running with the help of Eclipse of some other IDE. Because if you use these IDEs it will not be clear that how the application is deployed on server and you will not be able to understand the Servlet API specification very well.
Download a HelloWorld application from web and try to run it on Tomcat independently. This will give you clear picture how J2EE application is deployed and where different files need to be kept.
Following are things you may want to learn - Where do we keep the jar files in a application? - Where do we keep all class files ? - Where are my JSP/HTML/CSS files stored? - What is the CLASSPATH which J2EE container will look for?