When i add logic present tag to data.jsp i am not getting an error but my
page is still empty i think my arraylist is null but why? i'm waiting your
advices
tesla wrote:
>
> 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>
>
>
--
View this message in context:
http://old.nabble.com/Cannot-find-bean%3A-%22sendJsp%22-in-any-scope-tp27915481p27918564.html
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]