你要把servlet 放到别的目录 必须设置web.xml文件 参照examples的来做吧

解决方案 »

  1.   

    这样访问是不行的:
    http://localhost:8080/servlet/HelloWorldExample
    因为这样访问的话,系统会寻找servlet文件夹下的HelloWorldExample文件。
    就像对待examples一样对待servlet这几个字符如果想要访问http://localhost:8080/servlet/HelloWorldExample这样的方式来访问servlet
    要修改web.xml文件或者setclasspath.bat文件都可以解决
      

  2.   

    不啊,我写了几个简单的Servlet程序,放在root/web-inf/class下,都可以象
    http://localhost:8080/servlet/程序名 
    来访问的。