Question: I'm using IceFaces 1.8.2 with Tomcat 6

On a irregular basis I get the message "Connection is lost" with the option to reload the page. This is not acceptable for a public site.

My question now is if this approach makes sense:

```
 Ice.onConnectionLost('document:body',
 function() {

             window.location.href=window.location.href;
        });

```

The idea is to reload the current page on connectin problems. Do oyu think this would solve the issue or could this create other problems (I assume that reloading the current url is OK and does not cause any workflow issues).

Thanks.

Answer: 
I suggest using the `java.text.DateFormat` as shown in [this page](http://www.rgagnon.com/javadetails/java-0099.html) :

```
public static boolean isValidDateStr(String date) {
    try {
      SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
      sdf.setLenient(false);
      sdf.parse(date);
    }
    catch (ParseException e) {
      return false;
    }
    catch (IllegalArgumentException e) {
      return false;
    }
    return true;
  }

```
I thing using regex for this is almost impossible, due to the complex calculation required for leap years. Jon Skeet is right: use `new SimpleDateFormat("yyyyMMdd")` for this.