에 의해 호출 될 때 속성이없는 객체를 반환하는 Java Restful
웹 서비스가 있습니다. JSON
개체는 아래에서 볼 수 있습니다.정상적인 서비스가 정상적으로 반환되지 않습니다.
아래 이미지는 나머지 기능에서 반환되기 직전의 개체를 보여줍니다. 보시다시피 요일에는 우편 배달부에 나타나지 않는 가치가 있습니다.
backAbsence
엔티티는이 게시물의 끝에서 볼 수 있습니다.
SAbsence
은 backAbsence
엔티티의 목록입니다.
내가 왜
SAbsenece
을 반환 할 때 전체 모델이 우편 배달부에서 수신되지 않고 어떻게 해결해야합니까?
[
{
"name": "King sean",
"classidClass": 0,
"studentidStudent": 1,
"week": 14
},
{
"name": "Sean king",
"classidClass": 0,
"studentidStudent": 2,
"week": 14
}
]
나머지 기능 부 :
@GET
@Produces({"application/xml","application/json"})
@Path("{id}/{option}")
public List<BackAbsence> findbyClass(@PathParam("id")int id,
@PathParam("option")int option) {
List<BackAbsence> SAbsence = new ArrayList<>();
// code here fills list. The Image above shows the object with valid attributes
return SAbsence;
}
}
BackAbsnece 법인 :
public class BackAbsence {
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
private int classidClass;
private int studentidStudent;
private int monday = 0, tuesday = 0, wednesday = 0, thursday = 0, friday = 0;
private int week;
public BackAbsence() {
}
public BackAbsence(int idstudent, String name) {
this.studentidStudent = idstudent;
this.name = name;
}
public BackAbsence(int classidClass, int studentidStudent, int monday, int tuesday, int wednesday, int thursday, int friday,int week) {
this.classidClass = classidClass;
this.studentidStudent = studentidStudent;
this.monday = monday;
this.tuesday = tuesday;
this.wednesday = wednesday;
this.thursday = thursday;
this.week = week;
}
public int isMonday() {
return monday;
}
public void setMonday(int monday) {
this.monday = monday;
}
public int isTuesday() {
return tuesday;
}
public void setTuesday(int tuesday) {
this.tuesday = tuesday;
}
public int isWednesday() {
return wednesday;
}
public void setWednesday(int wednesday) {
this.wednesday = wednesday;
}
public int isThursday() {
return thursday;
}
public void setThursday(int thursday) {
this.thursday = thursday;
}
public int isFriday() {
return friday;
}
public void setFriday(int friday) {
this.friday = friday;
}
public int getClassidClass() {
return classidClass;
}
public void setClassidClass(int classidClass) {
this.classidClass = classidClass;
}
public int getStudentidStudent() {
return studentidStudent;
}
public void setStudentidStudent(int studentidStudent) {
this.studentidStudent = studentidStudent;
}
public int getWeek() {
return week;
}
public void setWeek(int week) {
this.week = week;
}
}