在server.xml的<host></host>加个Context
<Context path="myjsp" docBase="f:\\jsp" />其中myjsp是你的URL路径中应加的部分,可以换成任何你认为合适的字符串。
像上面这样配置的话,访问路径是:
http://localhost/myjsp/index.jsp
其中index.jsp文件放在f:\jsp下面

解决方案 »

  1.   

    在tomcat/conf/server.xml配置就可以
    楼上大哥说的非常清楚了
      

  2.   

    谢谢Tasia(灯盏),我分数如何给你啊??
      

  3.   

    还是不行啊!!还是这个错啊,请各位帮忙啊!!HTTP Status 404 - /shibug/HelloWorld.jsp--------------------------------------------------------------------------------type Status reportmessage /shibug/HelloWorld.jspdescription The requested resource (/shibug/HelloWorld.jsp) is not available.
    --------------------------------------------------------------------------------Apache Tomcat/5.0.19
      

  4.   

    我最近也被这个问题困扰 除了jsp以外还有servlet
      

  5.   

    你是配的<Context path="shibug" docBase="f:\\jsp" />??
      

  6.   

    In addition to nesting Context elements inside a Host element, you can also store them:in the individual $CATALINA_HOME/conf/context.xml file: the Context element information will be loaded by all webapps in the individual $CATALINA_HOME/conf/[enginename]/[hostname]/context.xml.default file: the Context element information will be loaded by all webapps of that host in individual files (with a ".xml" extension) in the $CATALINA_HOME/conf/[enginename]/[hostname]/ directory if the previous file was not found for this application, in individual file at /META-INF/context.xml inside the application files -----------------Please note that for tomcat 5, unlike tomcat 4.x, it is NOT recommended to place <Context> elements directly in the server.xml file. Instead, put them in the META-INF/context.xml directory of your WAR file or the conf directory as described above.