私のサーブレットでは、次の値で JSONObject が作成されます。
{'alerts':true}
を使用して JSP ページにその値を出力しようとすると、JSON オブジェクトが String として出力されます。として印刷されます。
"{'alerts':true}"
文字列ではなく JSON 形式で出力するにはどうすればよいですか?
サーブレットの場合:
public JSONObject getAudioAlerts() {
JSONObject val = new JSONObject("{'alerts':true}");
return val;
}
JSP の場合:
<br><br><json:property name="audioAlerts" value="${myBean.audioAlerts"}" />;
<br> Expected output: {'alerts':true}
<br>Acutal output: "{'alerts':true}"