package com.struts2.Book.Action;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test;
import bean.Book;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import data_tool.DBtool;
public class Query_BynameAction extends ActionSupport {
private String bookname;
private List list;
public List getList() {
return list;
}
public void setList(List list) {
this.list = list;
}
public String getBookname() {
return bookname;
}
public void setBookname(String bookname) {
this.bookname = bookname;
}
public String execute() {
// TODO Auto-generated method stub
System.out.println(bookname);
list=null;
//System.out.println("X");
list=DBtool.query_Byname(bookname);
//System.out.println("Y");
ActionContext.getContext().getSession().put("list", list);
return SUCCESS;
}
}
import java.util.ArrayList;
import java.util.List;
import org.junit.Test;
import bean.Book;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import data_tool.DBtool;
public class Query_BynameAction extends ActionSupport {
private String bookname;
private List list;
public List getList() {
return list;
}
public void setList(List list) {
this.list = list;
}
public String getBookname() {
return bookname;
}
public void setBookname(String bookname) {
this.bookname = bookname;
}
public String execute() {
// TODO Auto-generated method stub
System.out.println(bookname);
list=null;
//System.out.println("X");
list=DBtool.query_Byname(bookname);
//System.out.println("Y");
ActionContext.getContext().getSession().put("list", list);
return SUCCESS;
}
}