The bean:define will fail because its looking for something named "newArrayList" in 
request scope, but your code is putting the array list in request scope with the name 
"Book".

More over, I'd try to use a consistent naming stragegy between your Action.execute (or 
perform) where you're using newArrayList to mean the list of books, and the JSP page 
where you're referring to the same list with the name "Book". Look at the previous 
code and you'll see the consistent naming used in both place. It really helps other 
folks read your code.

Regards,
�
Rich


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 12, 2003 4:10 PM
To: [EMAIL PROTECTED]
Subject: Re: can't find bean using logic:iterator

Hi Rich,

These are the changes I have made so far :

Books.jsp :
 <bean:define id="newArrayList" name="newArrayList" scope="request"/>
    <logic:iterate id="conn" name="newArrayList" >
        <tr>
            <td>
                    <bean:write name="conn" property="EnglishISBN" />

            </td>
            <td>
                     <bean:write name="conn" property="EnglishAUTHOR" />
            </td>
        </tr>
    </logic:iterate>


BookAction :

ArrayList newArrayList = new ArrayList();

        ResultSet res = this.getResultSet();
        while (res.next()) {
            Book conn = new Book();
            conn.setEnglishISBN(res.getString("isbn"));
            conn.setEnglishAUTHOR(res.getString("author"));
            newArrayList.add(conn);
        }


        request.setAttribute("Book", newArrayList);


        return (mapping.findForward("techbooks"));


And I still get a 500  HTTP Status exception :

org.apache.jasper.JasperException: Cannot find bean newArrayList in scope 
request
    at 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:248)
    at 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
-----------
-----------

root cause 
javax.servlet.ServletException: Cannot find bean newArrayList in scope 
request
    at 
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:530)
    at org.apache.jsp.Books_jsp._jspService(Books_jsp.java:427)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to