Cody,
I'd suggest not using a custom tag to contain your list and instead just 
use a regular bean class.
You can then use the jsp:usebean tag to instantiate the bean and then I 
think the iterate tags will be able to call the getUserList method from the 
class

Regards,

Richard

At 12:17 PM 2/4/2002 -0600, you wrote:

>OK -
>
>So, not long ago, having read about MVC and having been introduced to
>Struts by discovering it on the Jakarta site, I embarked upon my journey to
>learn it.  Absolutely frustrated with the documentation (it appers to be
>written for people who happen to know a thing or two), and ffrustrated by
>the lack of support references in bookstores or the online community - I
>broke doen and started implementing my own MVC. Why? Because I at least
>found a step by step reference for how to do it.
>
>Anyways....
>
>Having done the MVC myself, I finally got to the place where I thought
>("OK, now I think I will probably be able to comprehend Struts").
>
>So I begin to convert my app.
>
>Here's where I stand:
>
>I've got all the tld's set and tested and struts is up and rearing to go
>(as far as I can tell).
>I've got Poolman set and tested; ready for use in the system (as I heard
>this was more robust than the b uilt-in Struts pool manager).
>Log4J is in.
>
>And now I am just stuck on the most basic, simplist things!
>
>
>I'm trying to iterate through a list and I am just stuck - somebody please
>help.  Here's what I have got:
>
>First, a custom tag called userList:
>
>
>***********************************************************************
>// UserListTag.java
>
>package com.magneta.tags;
>
>import org.apache.log4j.*;
>import java.util.List;
>import java.util.ArrayList;
>import javax.servlet.jsp.tagext.TagSupport;
>
>public class UserListTag extends TagSupport implements java.io.Serializable
>{
>
>     // a category instance for log4j logging
>     private Category cat = Category.getInstance(UserListTag.class.getName
>());
>
>     private List userList;
>
>         public int doStartTag() {
>
>             cat.debug("in doStartTag()");
>
>
>             userList = new ArrayList();
>             userList.add("cburleson001");
>             userList.add("bshoemate001");
>             userList.add("jacarey001");
>             userList.add("agilbert001");
>             userList.add("rafael001");
>             userList.add("margetic001");
>
>      cat.debug("storing userList bean in page scope");
>             pageContext.setAttribute("userList",userList);
>
>             return SKIP_BODY;
>
>         }
>
>         public List getUserList () {
>             return userList;
>         }
>
>}
>***************************************************************************
>
>
>Now, here's what I am trying to do on my JSP page - just simply iteratte
>through the list with the following...
>
>************************************************* from admin_userAdmin.jsp
>
><!-- initialize the user list (in bean in page scope) -->
>             <app:userList/>
>
>             <logic:iterate id="userList" name="userList">
>                 <bean:write name="userList" property="userList"/>
>             </logic:iterate>
>
>*******************************************************************
>
>BUT.... when I hit the page, I get the following exception
>
>"javax.servlet.ServletException: No getter method for property userList of
>bean userList"
>
>
>Can someone shed some light? Help me people - I am on square one.
>
>- Cody
>
>----------------------------------------------------------------
>The information transmitted is intended only for the person or entity to
>which it is addressed and may contain confidential and/or privileged
>material.  Any review, retransmission, dissemination or other use of, or
>taking of any action in reliance upon, this information by persons or
>entities other than the intended recipient is prohibited.   If you received
>this in error, please contact the sender and delete the material from any
>computer.
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>



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

Reply via email to