Locale in makeStandardHttpDateFormat
Brought to you by:
robertmartin,
slagyr
Running fitnesse in a different locale than US
generates ParseException when accessing pages.
eg.
java.text.ParseException: Unparseable date: "Wed, 03
Aug 2005 18:20:18 GMT"
at java.text.DateFormat.parse(Unknown Source)
at
fitnesse.responders.files.FileResponder.isNotModified
..
....
Solution:
In class Response
add Locale.US
public static SimpleDateFormat
makeStandardHttpDateFormat()
{
//SimpleDateFormat is not thread safe, so we need
to create each instance independently.
SimpleDateFormat df = new SimpleDateFormat("EEE,
dd MMM yyyy HH:mm:ss z",Locale.US);
df.setTimeZone(TimeZone.getTimeZone("GMT"));
return df;
}