HTML写错了!这样是不会直接调用servlet的
或者改为
    <html>
        <head><title>用servlet 显示文字</title></head>
        <body>
        <a href="/servlet/HelloWorld">HelloWorld</a>
        </body>
     </html>  楼主的HTML水平有待进步

解决方案 »

  1.   

    在Tomcat服务器中对Servlet的调用是否都需要在web.xml中注册呢?
      

  2.   

    风兄:   htm文件我改了,还是不行,报404错误,我的Servlet源程序放在WEB-INF\classes下,它怎么会找不到呢?
       会不会是其他什么问题!!!!
      

  3.   

    servlet的这个连接路径我应该怎么写呀?
      

  4.   

    你直接这样
    http://localhost/servlet/HelloWorld
    有反映么?
    如果有那么就是你的htm文件有问题
      

  5.   

    http://localhost/servlet/HelloWorld 哦!
    不是http://localhost/servlet/HelloWorld.java
    也不是http://localhost/servlet/HelloWorld.class哦!!
    最多会出现 404 not found而已 怎么会提示下载呢
      

  6.   

    我是这样的:
      我把Servlet源文件放在web-inf\classes下,然后再浏览器中直接输入:
      http://localhost:8080/servlet/HelloWorld,就提示下载文件,我也不知道
    是不是配置文件的原因...
      

  7.   

    http://expert.csdn.net/Expert/topic/1400/1400548.xml?temp=.7265894