i have a form ,if i submit it then i want the success message to be print from my json response in the same page.
I am getting many values from the json response but i only want the variable called as “message” which i have define in my java action.
The formated json response is like this
`{"errmsg":null,"jsonModel":null,"message":"Succussfuyly completed the task","model":
{"createdDate":null,"createrId":null,"id":null,"themeCaption":null,"themeName":null,
"themeScreenshot":null,"updateId":null,"updatedDate":null},"oper":null,"theme":{"createdDate":null,
"createrId":null,"id":null,"themeCaption":null,"themeName":null,"themeScreenshot":null,
"updateId":null,"updatedDate":null},"themeScreenshot":null}`
From this response i want only the message variable to be printed in my jsp page.
From my below jquery code ,all the value is printing in my jsp page. But i want only messsage variable.
index.jsp
<script type="text/javascript">
$(document).ready( function() {
$.subscribe('handleJsonResult', function(event,data) {
$('#result').html("<div id='languagesList'> <s:property value="Message"/> </div>"+'' + data.Message + '');
var list = $('#languagesList');
$.each(event.originalEvent.data, function(index, value) {
list.append('<h1>'+value+'</h1>\n');
});
});
});
</script>
</head>
<body>
<img id="indicator" src="${pageContext.request.contextPath}/images/others/ajax-loader.gif" alt="Loading..." style="display:none"/>
<s:form action="updatethemeimageform" method="post" enctype="multipart/form-data" id="remoteform" theme="simple" >
<s:hidden value="%{#parameters.themeid}" name="themId"/>
<s:file name="themeScreenshot" label="Theme Screenshot" />
<sj:a button="true" id="btnsid" buttonIcon="ui-icon-gear" dataType="json" indicator="indicator" onSuccessTopics="handleJsonResult"
formIds="remoteform" targets="result" >Submit This Form</sj:a>
</s:form>
<sj:div id="result" >
Json Result will come here
</sj:div>
`-----------
---------------
private String Message;
public String updateThemesImage(){
setMessage("Succussfuyly completed the task");
return SUCCESS;
}
------------
-----------
With getter & setters`
From my above jquery function i am geting output like this 
please help me to solve this problem
Your
eachloop is working correctly however if you only want several specific variables use object notation to retrieve them: