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;
  }

```
the regex for a leap year is very complex: case in point: (this also incorporates full date checking)

```
"(((\\d\\d)(0[48]|[2468][048]|[13579][26])|([02468][048]|[13579][26])(00))(02)([012]\\d))|(\\d\\d([02468][1235679]|[13579][01345789])(02)([01]\\d|2[012345678]))|(\\d\\d\\d\\d((0[13578]|1[02])([012]\\d|3[01])|((0[46]|11)([012]\\d|30))))"

```

first section separates out the the general case with non ending on 00

the second section handles the century year so only years divisable by 400 are leap years (1900 is not a leap year)

then in the last section it handles all the other months

(I didn't really test this but it should work close enough)