I'm using [SimpleCaptcha](http://simplecaptcha.sourceforge.net/)

My web.xml looks like the one [here](http://simplecaptcha.sourceforge.net/installing.html):

```
<servlet>
    <servlet-name>StickyCaptcha</servlet-name>
    <servlet-class>nl.captcha.servlet.StickyCaptchaServlet</servlet-class>
    <init-param>
        <param-name>width</param-name>
        <param-value>250</param-value>
    </init-param>
    <init-param>
        <param-name>height</param-name>
        <param-value>75</param-value>
    </init-param>
</servlet>

<servlet-mapping>
    <servlet-name>StickyCaptcha</servlet-name>
    <url-pattern>/captcha</url-pattern>
</servlet-mapping>

```

And i added a refresh but to my view like described in [this SO-answer](https://stackoverflow.com/questions/10151920/refresh-simple-captcha):

```
<script type="text/javascript">
    function reloadCaptcha(){
        var d = new Date();
        $("#captcha_image").attr("src", "/captcha?"+d.getTime());
    }
</script>
   ...
<img id="captcha_image" src="/captcha_generator.jsp" alt="captcha image" width="200" height="50"/>
<img src="reload.jpg" onclick="reloadCaptcha()" alt="reload"width="40" height="40"/>

```

But when i press the refresh button, nothing happens.
Also when i try to call `.../captcha?4324321` it still prints the same captcha (based on the user session as i understood it)

I'm also using spring-mvc and spring-webflow.
['https://Stackoverflow.com/questions/19315725', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2316112/']
Using `nl.captcha.servlet.SimpleCaptchaServlet` instead of `nl.captcha.servlet.StickyCaptchaServlet` solved the problem

because `StickyCaptchaServlet` uses the SessionId to create the image and `SimpleCaptchaServlet` doesn't
I think you may try:
$("#captcha\_image").attr("src", "/captcha\_generator.jsp");
instead of:
$("#captcha\_image").attr("src", "/captcha?"+d.getTime());