title: What is context in tomcat/conf/context.xml for? virtualhost?
body: <p>I was reading a book (school book) on jsp and there was something I couldn't understand. In the book we had to execute a jsp page and for that they set a context in servlet.xml in tomcat 5.5:</p>
  
  <pre><code>&lt;Context path="JSPTEST" docBase = "G:\Tomcat5.5"\webapps\JSPTEST"&gt;&lt;/Context&gt;
  </code></pre>
  
  <p>and the jsp in that folder is accessed at <code>http://localhost:8080/JSPTEST/filename.jsp</code></p>
  
  <p>The first thing I realized is that the docBase is actually a webapp on the server so with or without setting this context it will still run on the same <code>url</code> so what's the point?</p>
  
  <p>I installed a tomcat 7 and added a context to <code>conf/context.xml</code></p>
  
  <pre><code>Context docBase="F:\work\bscit\serverside\practical" path="serverside" reloadable="true" /&gt;
  </code></pre>
  
  <p>I put hello.jsp under the <code>practical</code> folder restarted the tomcat and there was no response.server was down with <a href="http://pastie.org/4354291" rel="nofollow">this in catalina_log</a>. To me that's another way to set a virtualhost (I have a good idea on how to create a virtualhost under apache httpd) so am kind of confused right now.</p>
  
  <p><strong>Question 1</strong> what exactly context are used for ? I've had a look at <a href="http://tomcat.apache.org/tomcat-6.0-doc/config/context.html" rel="nofollow">tomcat doc</a> it didn't ring the bell  </p>
  
  <p><strong>Question 2</strong> how can I make the "same" thing work on tomcat 7 (without putting the file in tomcat of course)?</p>