aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes How to run Servlet program on Eclipse.? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "How to run Servlet program on Eclipse.?" Watch "How to run Servlet program on Eclipse.?" New topic
Author

How to run Servlet program on Eclipse.?

Nitish Agrawal
Greenhorn

Joined: Feb 11, 2008
Posts: 21
Tell me the procedure plezzz...
Sachin Joshi
Ranch Hand

Joined: Aug 06, 2008
Posts: 83

Servlet requires a J2EE container to run. Download and Install Tomcat server and deploy as per J2EE specification.

your application folder structure should be like this


web.xml file needs to have details of your servlet .... so you may need to read more on J2EE deployment details


Web Development Tips and Tutorials - By Sachin
Nitish Agrawal
Greenhorn

Joined: Feb 11, 2008
Posts: 21
what should be the location of swervlet class.?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41818
    
  62
what should be the location of swervlet class.?

Sachin's post mentions that explicitly. If that's not what you're asking, tell us in detail what it is that you are asking.


Ping & DNS - my free Android networking tools app
Nitish Agrawal
Greenhorn

Joined: Feb 11, 2008
Posts: 21
what sachin mentioned is not correct,
as i tried that but it was giving error.
The error is " NOT a Java Source Folder."
Nitish Agrawal
Greenhorn

Joined: Feb 11, 2008
Posts: 21
I want to run a servlet program on Eclipse.
Just tell me the procedure or what steps i have to follow.?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41818
    
  62
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 ]
Sachin Joshi
Ranch Hand

Joined: Aug 06, 2008
Posts: 83

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?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to run Servlet program on Eclipse.?