Only two things are required in Eclipse for this:
One
In Eclipse, Window -> Preferences -> Server -> Runtime Environment
Specify your Web Server or Application Server path, by adding a "New Server Runtime Environment".
Update
Initially, there are only few Server Runtime Environments available with Eclipse like:
- Apache
- Basic
- ObjectWeb
On an additional note, you can add more Server Adapters using the link Download additional server adapters in Server Runtime Environments dialog screen.

Two
In Project Properties (Right Click on Project -> Properties), in Java Build Path, add Library "Server Runtime".
On adding Server Runtime to Project Library will add servlet-api.jar and jsp-api.jar jars to project dependencies.
