From 2ecaaee0b283d3753e31e780dfd2ea9af4087a8c Mon Sep 17 00:00:00 2001 From: Tracy Barlow Date: Sun, 6 Dec 2026 13:13:13 +0000 Subject: [PATCH 1/2] FIX: Mark the geo-location examples' values with dd, not dv The MVC example's example.jsp and the page the servlet example writes put each location value in a element, which HTML does not have, and their scripts made one for each value of the device's location. Inside the
, after each
, the value belongs in a
. Browsers showed the values anyway, as unknown elements, but without the meaning a description list gives them. Both examples now use
, in the markup and in the script that lists the device's location. --- .../src/main/webapp/WEB-INF/views/example.jsp | 10 +++++----- .../geolocation/web/examples/servlet/Example.java | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/location/geo-location.web.examples/geo-location.web.examples.mvc/src/main/webapp/WEB-INF/views/example.jsp b/location/geo-location.web.examples/geo-location.web.examples.mvc/src/main/webapp/WEB-INF/views/example.jsp index 11680fa43..48a65f7fd 100644 --- a/location/geo-location.web.examples/geo-location.web.examples.mvc/src/main/webapp/WEB-INF/views/example.jsp +++ b/location/geo-location.web.examples/geo-location.web.examples.mvc/src/main/webapp/WEB-INF/views/example.jsp @@ -41,13 +41,13 @@

Country
- ${county.hasValue() ? county.getValue() : "Unknown: ".concat(county.getNoValueMessage())} +
${county.hasValue() ? county.getValue() : "Unknown: ".concat(county.getNoValueMessage())}
State
- ${state.hasValue() ? state.getValue() : "Unknown: ".concat(state.getNoValueMessage())} +
${state.hasValue() ? state.getValue() : "Unknown: ".concat(state.getNoValueMessage())}
County
- ${country.hasValue() ? country.getValue() : "Unknown: ".concat(country.getNoValueMessage())} +
${country.hasValue() ? country.getValue() : "Unknown: ".concat(country.getNoValueMessage())}
Town/City
- ${town.hasValue() ? town.getValue() : "Unknown: ".concat(town.getNoValueMessage())} +
${town.hasValue() ? town.getValue() : "Unknown: ".concat(town.getNoValueMessage())}

When the button below is clicked, JavaScript running on the client-side will be used to obtain additional evidence (i.e. the location information from the device). If no additional information appears then it may indicate an external problem such as JavaScript being disabled in your browser. @@ -88,7 +88,7 @@ var list = document.createElement("dl"); fieldValues.forEach(function (entry) { var name = document.createElement("dt"); - var value = document.createElement('dv'); + var value = document.createElement('dd'); var bold = document.createElement('strong'); var fieldname = document.createTextNode(entry[0]); var fieldvalue = document.createTextNode(entry[1]); diff --git a/location/geo-location.web.examples/geo-location.web.examples.servlet/src/main/java/fiftyone/geolocation/web/examples/servlet/Example.java b/location/geo-location.web.examples/geo-location.web.examples.servlet/src/main/java/fiftyone/geolocation/web/examples/servlet/Example.java index f7580ce01..92d07ae88 100644 --- a/location/geo-location.web.examples/geo-location.web.examples.servlet/src/main/java/fiftyone/geolocation/web/examples/servlet/Example.java +++ b/location/geo-location.web.examples/geo-location.web.examples.servlet/src/main/java/fiftyone/geolocation/web/examples/servlet/Example.java @@ -138,13 +138,13 @@ protected void processRequest(HttpServletRequest request, HttpServletResponse re "

\n" + "
\n" + "
Country
\n" + - " " + (county.hasValue() ? county.getValue() : "Unknown: " + county.getNoValueMessage()) + "\n" + + "
" + (county.hasValue() ? county.getValue() : "Unknown: " + county.getNoValueMessage()) + "
\n" + "
State
\n" + - " " + (state.hasValue() ? state.getValue() : "Unknown: " + state.getNoValueMessage()) + "\n" + + "
" + (state.hasValue() ? state.getValue() : "Unknown: " + state.getNoValueMessage()) + "
\n" + "
County
\n" + - " " + (country.hasValue() ? country.getValue() : "Unknown: " + country.getNoValueMessage()) + "\n" + + "
" + (country.hasValue() ? country.getValue() : "Unknown: " + country.getNoValueMessage()) + "
\n" + "
Town/City
\n" + - " " + (town.hasValue() ? town.getValue() : "Unknown: " + town.getNoValueMessage()) + "\n" + + "
" + (town.hasValue() ? town.getValue() : "Unknown: " + town.getNoValueMessage()) + "
\n" + "
\n" + "

\n" + " When the button below is clicked, JavaScript running on the client-side will be used to obtain additional evidence (i.e. the location information from the device). If no additional information appears then it may indicate an external problem such as JavaScript being disabled in your browser.\n" + @@ -185,7 +185,7 @@ protected void processRequest(HttpServletRequest request, HttpServletResponse re " var list = document.createElement('dl');\n" + " fieldValues.forEach(function (entry) {\n" + " var name = document.createElement('dt');\n" + - " var value = document.createElement('dv');\n" + + " var value = document.createElement('dd');\n" + " var bold = document.createElement('strong');\n" + " var fieldname = document.createTextNode(entry[0]);\n" + " var fieldvalue = document.createTextNode(entry[1]);\n" + From eef7b95df7e6a3cc0886431e3d12345ff8446dfe Mon Sep 17 00:00:00 2001 From: Tracy Barlow Date: Sun, 6 Dec 2026 13:18:26 +0000 Subject: [PATCH 2/2] FIX: Show each place in its own row in the geo-location web examples The MVC and servlet examples showed the county in the Country row and the country in the County row, and their scripts filled County from data.location.country. When the location came back empty, the scripts called fieldValue.push, which does not exist, so the list never appeared. Each row now shows its own value, the script reads data.location.county, and fieldValues.push is used throughout. "sever-side" is now "server-side". rc fixed the same lines in #303, which also changed how the controller passes the values. main keeps its own controller, so only these lines are brought across. --- .../src/main/webapp/WEB-INF/views/example.jsp | 10 +++++----- .../geolocation/web/examples/servlet/Example.java | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/location/geo-location.web.examples/geo-location.web.examples.mvc/src/main/webapp/WEB-INF/views/example.jsp b/location/geo-location.web.examples/geo-location.web.examples.mvc/src/main/webapp/WEB-INF/views/example.jsp index 48a65f7fd..655ae1605 100644 --- a/location/geo-location.web.examples/geo-location.web.examples.mvc/src/main/webapp/WEB-INF/views/example.jsp +++ b/location/geo-location.web.examples/geo-location.web.examples.mvc/src/main/webapp/WEB-INF/views/example.jsp @@ -35,17 +35,17 @@

- The following values are determined sever-side on the first request. + The following values are determined server-side on the first request. As the server has no location information to work from, these values will all be unknown:

Country
-
${county.hasValue() ? county.getValue() : "Unknown: ".concat(county.getNoValueMessage())}
+
${country.hasValue() ? country.getValue() : "Unknown: ".concat(country.getNoValueMessage())}
State
${state.hasValue() ? state.getValue() : "Unknown: ".concat(state.getNoValueMessage())}
County
-
${country.hasValue() ? country.getValue() : "Unknown: ".concat(country.getNoValueMessage())}
+
${county.hasValue() ? county.getValue() : "Unknown: ".concat(county.getNoValueMessage())}
Town/City
${town.hasValue() ? town.getValue() : "Unknown: ".concat(town.getNoValueMessage())}
@@ -74,11 +74,11 @@ if (data.location) { fieldValues.push(["Country", data.location.country]); fieldValues.push(["State", data.location.state]); - fieldValues.push(["County", data.location.country]); + fieldValues.push(["County", data.location.county]); fieldValues.push(["Town/City", data.location.town]); } else { - fieldValue.push(["Location data is empty. This probably means that something has gone wrong with the JavaScript evaluation.", ""]) + fieldValues.push(["Location data is empty. This probably means that something has gone wrong with the JavaScript evaluation.", ""]) } displayValues(fieldValues); }, 'location'); diff --git a/location/geo-location.web.examples/geo-location.web.examples.servlet/src/main/java/fiftyone/geolocation/web/examples/servlet/Example.java b/location/geo-location.web.examples/geo-location.web.examples.servlet/src/main/java/fiftyone/geolocation/web/examples/servlet/Example.java index 92d07ae88..b7d974347 100644 --- a/location/geo-location.web.examples/geo-location.web.examples.servlet/src/main/java/fiftyone/geolocation/web/examples/servlet/Example.java +++ b/location/geo-location.web.examples/geo-location.web.examples.servlet/src/main/java/fiftyone/geolocation/web/examples/servlet/Example.java @@ -132,17 +132,17 @@ protected void processRequest(HttpServletRequest request, HttpServletResponse re "\n" + "
\n" + "

\n" + - " The following values are determined sever-side on the first request.\n" + + " The following values are determined server-side on the first request.\n" + " As the server has no location information to work from, these \n" + " values will all be unknown:\n" + "

\n" + "
\n" + "
Country
\n" + - "
" + (county.hasValue() ? county.getValue() : "Unknown: " + county.getNoValueMessage()) + "
\n" + + "
" + (country.hasValue() ? country.getValue() : "Unknown: " + country.getNoValueMessage()) + "
\n" + "
State
\n" + "
" + (state.hasValue() ? state.getValue() : "Unknown: " + state.getNoValueMessage()) + "
\n" + "
County
\n" + - "
" + (country.hasValue() ? country.getValue() : "Unknown: " + country.getNoValueMessage()) + "
\n" + + "
" + (county.hasValue() ? county.getValue() : "Unknown: " + county.getNoValueMessage()) + "
\n" + "
Town/City
\n" + "
" + (town.hasValue() ? town.getValue() : "Unknown: " + town.getNoValueMessage()) + "
\n" + "
\n" + @@ -171,11 +171,11 @@ protected void processRequest(HttpServletRequest request, HttpServletResponse re " if (data.location) {\n" + " fieldValues.push([\"Country\", data.location.country]);\n" + " fieldValues.push([\"State\", data.location.state]);\n" + - " fieldValues.push([\"County\", data.location.country]);\n" + + " fieldValues.push([\"County\", data.location.county]);\n" + " fieldValues.push([\"Town/City\", data.location.town]);\n" + " }\n" + " else {\n" + - " fieldValue.push([\"Location data is empty. This probably means that something has gone wrong with the JavaScript evaluation.\", \"\"])\n" + + " fieldValues.push([\"Location data is empty. This probably means that something has gone wrong with the JavaScript evaluation.\", \"\"])\n" + " }\n" + " displayValues(fieldValues);\n" + " }, 'location');\n" +