I need load the content of a Object JSON in many divs, but in parts. For example,
My JSON structure:
{"Example": {
"Hi": "hi",
"Bye": "bye"
}
}
Assuming that the JSON string successfully load my JSP page. I am trying to load the contents of the JSON like this:
(For the attribute Hi
and Bye
)
<sj:div id="div1" dataType = "json">
<s:property value="Example.Hi"/>
</sj:div>
<sj:div id="div2" dataType = "json">
<s:property value="Example.Bye"/>
</sj:div>
Struts.xml:
<action name="name" class="class" method="method">
<result type="json">
<param name="root">
Example
</param>
</result>
</action>
but this doesn't work... What I can do?
I'm using: Struts2 Jquery Library