Please tell whether my bean and actionform are correct. the code is given below
code:
Bean code
public class BookBean {
private
String author;
private String title;
private String available;
private int id;
public BookBean(int id,String author,String title,String available)
{
this.id=id;
this.author=author;
this.title=title;
this.available=available;
}
public void setId(int id)
{
this.id=id;
}
public int getId()
{
return id;
}
public void setAuthor(String author)
{
this.author=author;
}
public String getAuthor(){
return author;
}
public void setTitle(String title){
this.title=title;
}
public String getTitle()
{
return title;
}
public void setAvailable(String available)
{
this.available=available;
}
public String getAvailable()
{
return available;
}
public BookBean() {
}
}
ActionForm
public class BookForm extends org.apache.struts.action.ActionForm {
private List bookBean;
public void setBookBean(List bookBean)
{
this.bookBean=bookBean;
}
public List getBookBean(){
return bookBean;
}
public BookBean getBookBean(int index) {
return (BookBean)bookBean.get(index);
}
public void setBookBean(int index, BookBean bean) {
this.bookBean.set(index, bean);
}
/**
*
*/
public BookForm() {
super();
}
}
Please tell me whether all the getter, setter methods are correct and returning the correct type. i am confused with the indexed getter and setter methods.