package tutorial;
import java.util.ArrayList;
import java.util.List;
import com.googlecode.jsonplugin.annotations.JSON;
import com.opensymphony.xwork2.ActionSupport;
public class JsonPluginAction extends ActionSupport {
private int bookId;
private String title;
private double price;
private List comments = new ArrayList();;
private transient String secret1;
private String secret2;
@JSON(name = "ISBN")
public int getBookId() {
return bookId;
}
public void setBookId(int bookId) {
this.bookId = bookId;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}
public List getComments() {
return comments;
}
public void setComments(List comments) {
this.comments = comments;
}
public String getSecret1() {
return secret1;
}
public void setSecret1(String secret1) {
this.secret1 = secret1;
}
public String getSecret2() {
return secret2;
}
@Override
public String execute() throws Exception {
bookId = 1234567;
title = "how are you";
price = 12.5;
comments.add("经济改革");
comments.add("社会变更");
comments.add("人文风俗");
secret1 = "It is very nice to meet you";
secret2 = "I love you!";
return "success";
}
public void setSecret2(String secret2) {
this.secret2 = secret2;
}
}
评论1
最新资源