On the jsp page; I have a logic:iterate tag which loops through data from an xml file and displays it within a drop down. How do i take and store the selected option from the drop down into the form-bean for processing.

<html:select name="BookForm" property="book" multiple="true">

<bean:define name="BookForm" property="BookList" id="bklist" />
<html:options collection="bklist" property="bookId" labelProperty="bookName" />

public class Book{
int  bookId;
String bookName;

public int getBookId() {
    return medId;

public void setBookId(int bookId) {
    this.bookId = bookId;

public String getBookName() {
    return bookName;

public void setBookName(String bookName) {
    this. bookName =  bookName;

public class BookForm {
private List bookList;
private String[] book;
public void setBookList(List medList){
    this.bookList = bookList;

public List getBookList(){
    return this.bookList;

public String[] getBook() {
    return book;

public void setBook(String[] book) {
    this.book = book;

 public static List getBooks(){
    PreparedStatement pStmt = null;
 Connection con = null;
 boolean success = false;
 ResultSet rs = null;
 List bookList = new ArrayList();

     conn = getConnection();

     String sql = " select * from BOOK ";
     pStmt = conn.prepareStatement(sql);

     rs = pStmt.executeQuery();
         Book book= new Book();
 }catch(Exception e){

 return bookList;    
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.