I am trying to understand how to use JSON and in the process I\'m trying to get a JSON response from Struts2 action and display an alert for the response. For this I\'m usin
The problem in your Action class MeetingRecordAction, method updateAttendeesRecord is private, it should be public
public String updateAttendeesRecord() {
meetingRecordService.updateAttendeesRecord(attendeesListMethod(), meeting_record);
setMyMsg("Update Successful!");
return SUCCESS;
}
In the action configuration you should not override the default configuration from json-default
package just extend it and all. Also json-default
extend a struts-default
, so multiple inheritance is not required.
<package name="default" extends="json-default">
<action name="meeting_record_form" class="com.task.action.MeetingRecordAction" method="updateAttendeesRecord">
<result name="success" type="json" />
</action>
</package>
I've solved my problem by adding myMsg on the json result. Thanks for all the help