<servlet>  
    <servlet-name>captchaServlet</servlet-name>  
    <servlet-class>CaptchaServlet</servlet-class>  
  </servlet>  
    <servlet-mapping>
    <servlet-name>captchaServlet</servlet-name>
    <url-pattern>/patchca.png</url-pattern>
  </servlet-mapping>
其他都没错,至少在XML配置时候少了。

解决方案 »

  1.   

    其他都没错,只是在XML配置时候少了。
      

  2.   

    这个我配了,是我忘了粘了。是这部分吧。  <servlet>
        <description>This is the description of my J2EE component</description>
        <display-name>This is the display name of my J2EE component</display-name>
        <servlet-name>CaptchaServlet</servlet-name>
        <servlet-class>com.test.servlet.CaptchaServlet</servlet-class>
      </servlet>
    这些都有,可问题就是不能解决。
      

  3.   

    <form action="验证码Servlet">
      

  4.   

    在doPost()调用doGet()方法,<form method="post">,省略action属性,试试
      

  5.   

    试过了,不行。
    form action是跳转到另一个检验输入结果正确与否的页面go.jsp,好像不是这里的问题。继续坐等指教。
      

  6.   

    我已经试过了,是可以的,还不行的找我  [email protected]
      

  7.   

    奇怪,我的怎么不行。本地环境,mycelipse,ssh框架,验证码jsp页面文件夹目录在根目录下,与WEB-INF同级。
      

  8.   


      <td><img src="/<%=path %>/patchca.png" alt="验证码"style="cursor:pointer;vertical-align:text-bottom;" onclick="this.src='/<%=path %>/patchca.png'+'?'+Math.random();"></td>
      

  9.   

    http://download.csdn.net/detail/s478853630/4064638
    注释齐全,你都看得懂的
      

  10.   

    全部不行,jsp页面仍然刷不出验证码图片,持续读取,没有结果。也不报错。我觉得各位的配置应该都没有问题,但我的机器就是刷不出来,很费解啊这个事,崩溃。
      

  11.   

    ff ie都试过,不行,难道这个问题真要僵死了吗。
      

  12.   

    可能是验证码servlet的代码有问题,我以前也遇到这问题
      

  13.   

    我一行一行的找了一下原因,发现servlet中,跳入这一行的时候,就不往下走了,也没有报错!
    Graphics graphics=image.createGraphics()