In my Servlet a JSONObject is created with the value:
{'alerts':true}
When I am trying to print its value on JSP page using , it is printing the JSON object as String . It is printed as
"{'alerts':true}"
How do I print in JSON format rather than String?
In Servlet:
public JSONObject getAudioAlerts() {
JSONObject val = new JSONObject("{'alerts':true}");
return val;
}
In JSP:
<br><br><json:property name="audioAlerts" value="${myBean.audioAlerts"}" />;
<br> Expected output: {'alerts':true}
<br>Acutal output: "{'alerts':true}"