Hi list,

I investigated a problem with Geoserver integrated Freemarker Templates using Eclipse Adoptium: 21.0.8 (OpenJDK 64-Bit Server VM)

in my freemarker Template I had

<#setting locale="en_US">
<#setting boolean_format="0,1">
<#setting date_format="dd.MM.yyyy">
<#setting datetime_format="dd.MM.yyyy HH:mm">
<#setting time_zone="Europe/Berlin">

and

<td><b>Datum Uhrzeit:</b></td>
<td><#if feature.datum.value != ''> ${feature.datum.value?datetime("MMM dd, yyyy, h:mm:ss a")} Uhr <#else> keine Angabe</#if></td>

This gave "Unparseable date: &quot;Mar 30, 2024, 1:12:27 PM&quot;" on getFeatureInfo request.

Solution: copy the unparseable date into your freemarker template text editor and use the "Narrow No-Break Space" between h:mm:ss and a.

see: https://bugs.openjdk.org/browse/JDK-8324308

ADDITIONAL SYSTEM INFORMATION :
Occurs in JDK 20, 21 and 22, but not in older ones like JDK 18 and 19.

A DESCRIPTION OF THE PROBLEM :
The US DateTimeFormatter uses a "Narrow No-Break Space" since JDK 20. This special character is used instead of a normal space before "AM" and "PM". Especially for parsing a users input that is an serious problem, because users can not type this character on a normal keyboard. They also could not see the difference, so an error message with an example of an correct formatted DateTime could not help.

REGRESSION : Last worked in version 19

--
Dipl.Ing. Stefan Overkamp
https://mapstore.geodaten-velbert.de
_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to