Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

Cannot find bean: "sendJsp" in any scope

tesla

2010-03-16

Replies: Find Java Web Hosting

Author LoginPost Reply

Hi
I wanna show my arrayList on the screen by using logic:iterate tag but when
i run my application i am gettig this error.I'm working on this application
for two days and still i cant see my arraylist elements on the browser.
Thanks in advice.

data.jsp

<logic:iterate id="book" name="sendJsp"  property="bookList">
  <bean:write name="book" property="name"/>
</logic:iterate>

Book.java

public class Book {
 
  private String name;
  private String description;
  private int price;
  private int id;

  public Book()
 {
   
 }
  public Book(String name)
  {
    this.name=name;
  }

  public ArrayList<Book> loadData()
  {
     ArrayList<Book> kitapListesi = new ArrayList<Book>();
     kitapListesi.add(new Book("calculus1"));
      kitapListesi.add(new Book("calculus2"));
     return kitapListesi;
  }

BookAction.java

public ActionForward execute(ActionMapping mapping, ActionForm form,
       HttpServletRequest request, HttpServletResponse response)
       throws Exception {

 
    BookForm bookForm = (BookForm) form;
    Book book = new Book();
    bookForm.setBookList(book.loadData());
    request.setAttribute("sendJsp", bookForm.getBookList());
    return mapping.findForward(SUCCESS);
  }

BookForm.Java

public class BookForm extends org.apache.struts.action.ActionForm {
 
private ArrayList<Book> bookList = new ArrayList<Book>();

  public BookForm() {
    super();
    // TODO Auto-generated constructor stub
  }
  public ArrayList<Book> getBookList() { return bookList; }
public void setBookList(ArrayList<Book> bookList) { this.bookList =
bookList; }

struts_config.xml

<form-bean name="BookForm" type="paket.BookForm"></form-bean>>

<action input="/data.jsp" name="BookForm" path="/data" scope="request"
type="paket.BookAction" >
</action>

--
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 gg3721.com - Jax Systems, LLC, U.S.A.