Document root is where you keep your web files and it is an absolute path on your file system. Context root is a kind of virtual directory for web users to access web files.
Ex:
Web Server/Servlet Container -
Tomcat You can place all your web files (html,
jsp, classes etc.) in C:\MyProject directory and it is your document directory. You specify this in Tomcat configuration.
In Tomcat configuration file you can specify "/myweb" as context root of your web application. Web users access this application with something like "http://myweb/...".