You need to integrate the servlet container into Eclipse and link it to your Dynamic Web Project. By default, Eclipse does not come with a servlet container. You need to download and install it separately. Widely used is Apache Tomcat . Just download the zip and extract it somewhere.
Then in Eclipse, go to the Servers view in the box on the right. Then add a new server where you select Apache Tomcat 6 from the list and specify the root folder of Tomcat (where you extracted it). You can then select it from the Target Runtime drop-down list during the creation of the Dynamic Web Project Creation Wizard. Or if you have already created one, but havenโt connected it to the server, then change it in the "Target deadlines" section of the project properties. Thus, server libraries will be automatically added to the project creation path. This, finally, is the whole point. The server is basically a concrete implementation of the abstract servlet API. It has all the API libraries in its /lib folder.
Here's a video tutorial (which does it a little differently than described above, but that's also enough), and here's a text / screenshot (you can just skip part of the JSF if thatโs not interesting yet).
source share