Getting JSON object from Java in Struts 2

后端 未结 1 1473
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-23 17:01

I am trying to get response text from java server using getJSON jQuery method. Although, I can get response data when the java class is simple format (Strin

1条回答
  •  被撕碎了的回忆
    2021-01-23 17:46

    Try the following code, it should fix the error

    data += "{";
    data += "\"objid\":\"" + employee.getEmployeeId() + "\",";
    data += "\"id\":\"" + employee.getId() + "\",\"name\":\"" + employee.getName() + "\",";
    data += ",\"dob\":\"" + profile.getDob() + "\",\"sex\":\"" + profile.getSex() + "\",";
    data += ",\"email\":\"" + profile.getEmail() + "\",\"workstart\":\"" + profile.getWorkstart() + "\",";
    data += ",\"study\":\"" + profile.getStudySub() + "\",\"jplevel\":\"" + profile.getJpLevel() + "\",";
    data += ",\"jpgroup\":\"" + profile.getJpGroup() + "\",\"remark\":\"" + profile.getRemark() + "\"";
    data += "}";
    

    0 讨论(0)
提交回复
热议问题