JSTL Date Formatting is Locale/Language Sensitive
Ever write a JSP that contained JSTL-formatted dates? Ever found that the formatted date appears differently when requested via a text client like wget?
I recently built a web page that uses JSTL to format dates using the pattern "dd MMM, HH:mm:ss". In a browser this renders as: "04 Nov, 13:03:00". However, I found that when I requested the page using wget, the dates were formatted like so: "2006-11-03 13:03:00.0". I found a post at sourceforge that suggested setting the locale for JSTL in the page itself. I didn't want to have to modify the JSP so after some trial and error found that sending the header "Accept-Language: en" in the wget request fixed the problem. *sigh*
It's little frustrations like this that build up and make me (and others I bet too) want to look for other solutions and/or frameworks. GRRR!!!

0 Comments:
Post a Comment
<< Home