I have written a code for java to Json, while retrieving a Sting value from a Page that is Latitude from a Page properties throwing an error
: java.lang.ClassCastException.
Here I am using ValueMap
if it contains that latitude value then I have to store it in Double. The Code sample is
import org.apache.sling.api.resource.ValueMap
private static final String G_LAT = "37.7608337";
protected ValueMap pageProp;
Double lat = null;
if(pageProp.containsKey(G_LAT))
lat = (Double) pageProp.get(G_LAT); // Getting an exception here
Thank You for any help!