Struts 2.2, Json data and jsp problem, help pls
Hi
I am using struts 2.20, jsp and strutsjson plugIn. I have download plugIn into WEB-INF/lib directory. I think plugIn seem to be working.
I have following action <p>
public class CreateJsonAction implements Action
{
JSONObject obj2=new JSONObject();
obj2.put("StartDate","2007-04-12 11:00:00");
obj2.put("GoogleRef","60.472024, 8.468946");
obj2.put("Element","Sleeve/Backup");
obj2.put("Film","Golden Child");
List<JSONObject> myJsonList = new
ArrayList<JSONObject>();
myJsonList.add(obj);
return SUCCESS;
}
struts.xml
<action name="FilmJsonAction3"
class="web.struts.test.MyJsonAction">
<result name="success"
type="json">/WEB-INF/jsp/json.jsp</result>
</action>
When I call this action from the browser, the action get activated and json data is pumped to the browser. But it displaying json data as string in a new window and doesn't open requested jsp ie json.jsp.
Please can you help me, how can I applied this json data (list if json data) to my jsp. So when I open this jsp page, data get populated. I would appreciated an example.
many thank
ish
|