I have an action class in which many action methods are defined and appropriate getters and setters methods are also defined. I have some action methods from which I get the data as json by calling them from jQuery. but when I get the json data it includes all the fields for which getters and setters are defined but i want to get only that field which is filled by that method to which i am calling. for example-
public class ApplicantRegistration extends ActionSupport{
private String s1;
private XyzBean bean;
private String s2;
// respective getters and setters....
public String m1(){
// some work
return SUCCESS;
}
public String m2(){
//some work
s2="abc";
return SUCCESS;
}
}
when i call method m2 via jQuery and get json response it gives
{
s1: null,
bean: null,
s2:"abc",
m2: "success",
}
but I want only
{
s2:"abc"
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…