RaceBase
RaceBase

Reputation: 18848

Ajax Response for a JSON Data

I am using AJAX to cal my struts action class and it's storing some data in session.

public String myMethod(){
     session.put("DATA", JSON_STRING); //JSON formatted string
     return "forward";
}

I am forwarding to a jsp page in which I am printing this data

<%@taglib prefix="s" uri="/struts-tags"%>
<s:property value="#session['DATA']" />

So in the end I am receiving the AJAX Call Response

[{&quot;title&quot;: &quot;OFP LALOUV0042/ODF96-02 PD/FP16 (L)&quot;, &quot;key&quot;: &quot;551&quot;}]

What I am expecting is

[{"title": "OFP LALOUV0042/ODF96-02 PD/FP16 (L)", "key": "551"}]

Upvotes: 0

Views: 202

Answers (1)

Foredoomed
Foredoomed

Reputation: 2239

Try this:

<s:property value="#session['DATA']" escapeHtml="false" />

Upvotes: 1

Related Questions