Question on logic:iterate

Hi,
I have stored HashMap in Application scope.This HashMap stored collection of objects.
Each object has its getter setter methods.
Application scope attribute = "all"
Hashmap stored in this attribute = "hm"
object stored in hm = key:"all" , value="chatroom"
Now how can i get the getter setter value displayed on page of chatroom object using Logic:iterate.
Thanks in advance

<logic:iterate id="db" name="dbForm">
<tr>
<td>
<bean:write name="db" property="name"/>
</td> <td><bean:write name="db" property="name1"/></td>
</tr>
</logic:iterate >
dbForm is my form name where i have getname,getname1 for storing two
ArrayList..
but i find error as Cannot create iterator for this collection;(
where i went wrong;(

Similar Messages

  • Not able to use collection multiple times in a jsp using logic:iterate

    I have following question:
    I am working on a report using J2EE. I have a collection(resultset) which has 3 different types of vendors information along with other information in the collection and I want to put them into 3 different sections on my report depend on vendor type in the collection (resultset).
    Anyone know that I can able to use same collection multiple times uisng <logic:iterate> or is any other way of doing this.
    Thanks,

    Enable the logs on your router. Then try to do remote desktop. It will fail of course. After it does, view the logs, there might be ports listed in the incoming logs that you failed to forward.

  • Got a list of empls but how to iterate them with  logic:iterate?

    Hi there,
    quick question:
    Say I have a class Empl with the properties: fname and id (getter and setters as well).
    I also have a list of empl emplList that has 100 objects of type empl.
    in plain java if I wish to iterate them it will simply be:
    for (int x=0; x<listEmpl.length(); x++)
          Empl empl = (Empl) listEmpl.get(x);
          System.out.println(empl.getFname());
          System.out.println(empl.getId());
    }my question is how could I do that with logic:iterate? and what should come in the ActionForm? is it:
    private List emplList = new ArrayList();
    private List getEmplList();
    private void setEmplList(List list) ???
    thanks for any pointers

    thanks for your reply.
    I did this:
    private List emplList = new ArrayList();
         public List getEmplList()
              return emplList;
         public void setEmplList(List emplList)
              this.emplList = emplList;
         }I added some bogus information in the constructor.
         public emplForm()
              for (int x=0; x<10; x++)
                   Empl e = new Empl();
                   e.setFname("ffff"+x);
                   e.setTravelerID(x);
                   emplList.add(e);
         }for some reason, the code you provided didn't work. Do you think there's something wrong with the emplList?
    thanks again

  • Ajax input inside logic:iterate

    sorry.. topic sent to the wrong forum inadvertantly..
    Message was edited by:
    nisha20

    Hi Nisha,
    I think I am facing a similar kind of problem like the one you have posted. Can you or anyone else help me out in this?
    Here is my problem ---------------------->>>
    I am having a page with a table whose data I am pre-populating when the page loads. The data is coming from the database based on the name of the user.
    The page gets loaded via a struts action call and the table data are populated using the <logic:iterate> and <bean:write> tags.
    Now, I have a drop down list, which contains the list of all possible users. If I change the user name from this drop-down my table data should change and this should be done without refreshing the page, which means I have to use AJAX.
    SO, my question is, how can I get the changed data placed into the table without having to change the existing codes for <logic:iterate>?
    Can anyone please help me on this?
    Thanks in advance.
    Regards

  • Pls help me writing logic:iterate tag in jsp page

    Hey guys , I am struck in retriving string p1,p2,p3 in the jsp page
    Pls have a look ata the code
    In DAO class:-
    StdprdDAO.java
    Public arrayList getPFP()
    ArrayList a = new ArrayList();
    While(rs.next())
         columnsVO colVO = new columnsVO;
         colVO.setProduct(rset.getString(1));//will store in String colProduct
         colVO.setFamily(rset.getString(2));//will store in String colFamily
    colVO.setPrice(rset.getString(3));//will store in String colPrice
    a.add(colVO);
    return a;
    In Action Class:-
    ArrayList final = null;
    StdprdDAO DAO = new stdprdDAO();
    final = DAO.getPFP();
    For(int i = 0; final !=null && i<final.size() ; i++)
         columnsVO VO = null;
         VO = (columnsVO)final.get(i);
         String p1 = (String) VO.getProduct();
         String p2 = (String) VO.getFamily();
         String p3 = (String) VO.getPrice();
         Request.setAttribute(“p1”,p1);
         Request.setAttribute(“p2”,p2);
         Request.setAttribute(“p3”,p3);
    In JSP PAGE:-
    id = “columnsVO”>
    <bean:write name = “columnsVO” property=”final” id=”p1”>
    but still I am doubting my above sentences in jsp page ,so pls correct them if possible.
    Instead of l;ogic:iterate can I use directly getattribute(“p1”)? <logic:iterate
    Still I m doubting I can not utilize columnsVO file in logic:iterate, I can utilize only formbean file.
    So pls help me with this.

    May I ask why have you done it?
    If it is related to printing of the list then it is of no use.But it IS of use. The objects compEmployees is in scope.
    It has the list we want to print out.
    With logic:iterate:
    <table>
         <tr>
           <th>Number</th>
           <th>Employee</th>
         </tr>
         <logic:iterate name="compEmployees" property="totalEmps" id="emp">
              <tr>
                <td>
                  <bean:write name="emp" property="empNo"/>
                </td>
                <td>
                  <bean:write name="emp" property="empName"/>
                </td>
              </tr>
         </logic:iterate>
    </table>or alternatively with JSTL and c:forEach
    <table>
         <tr>
           <th>Number</th>
           <th>Employee</th>
         </tr>
         <c:forEach items="${compEmployees.totalEmps}" var="emp">
              <tr>
                <td>
                  <c:out value="${emp.empNo}"/>
                </td>
                <td>
                  <c:out value="${emp.empName}"/>
                </td>
              </tr>
         </c:forEach>
    </table>Cheers,
    evnafets

  • Using Logic iterate to display a arraylist in STRUts

    I m having a form bean containg a string array......
    <form-bean
    name="myDynaForm"
    type="org.apache.struts.validator.DynaValidatorForm">
    <form-property name="names" type="java.lang.String[]" />
    </form- bean>
    and in my jsp , i m using .......
    <logic:iterate name="myDynaForm" property="names" id="names" >
    <tr>
    <td class="style3" align="left" width="30%" >
    <html:textarea property="names" cols="40" rows="2" size="40" indexed="true" readonly="true" />
    </td>
    </tr>
    Now this code is printing only the first element of String names.
    How can i print all the elemts of answer in my jsp

    How could you do the same thing but using only two cells?
    where the check box returns a specific value in the second.
    in this instance its for a staff registration sheet where a checkbox in (A) would return a set value in (B)
    i know this might sound simple to you guys in the know but i cant figure it out! I have been messing around trying things with the if function but still only shows me the red triangle (syntax error).
    A simple solution would be much appreciated.

  • Using Strut Logic Iterate tag in JavaScript

    Has anyone tried this or experienced this problem.
    I have JSP pages with JavaScript imbedded. Not my web page but an out of the box portal we bought from a vendor. The JavaScript uses the Logic Iterate Strut tag but gives an error in Nitro:
    "feature is not resolved" on the lines where getLink() and getID() are called. I have put the code in other editors and it does not give me any error. Does any one have a clue to why this error occurs or is this something that NitroX can not handle?
    Thanks,
    Zim 8)
    Some of Code:
    function selectFolder(folderName,doExpandPath)
                        if (typeof(doExpandPath) == 'undefined')
                             doExpandPath = true;
                        var form = document.forms['TreeForm'];
                        // unselect old one
                        var cell = document.getElementById(selectedId);
                        if (null != cell)
                             cell.className = '';
                        // select new one
                        if ('/' == folderName.charAt(folderName.length-1))
                             folderName = folderName.substring(0,folderName.length-1);
                        var targetCellId = 'cellLabel./Documents'+folderName;
                        var isContentFolderBrowser = true;
                        try {
                             var sideBarSelected = top.frames['main'].window.sideBarSelected;
                             isContentFolderBrowser = '/getfolderitems.do' == sideBarSelected;
                             if (!isContentFolderBrowser) {
                             <logic:iterate id="feature" name="userinfobean" property="sideBarFeatures"
                                       type="com.actuate.activeportal.functionality.config.Feature">
                                       if (sideBarSelected == '<%= feature.getLink()%>' )
                                            targetCellId = 'cellLabel./<%= feature.getID()%>';
                                  </logic:iterate>
                        } catch (e) {
                        cell = document.getElementById(targetCellId);

    May I ask why have you done it?
    If it is related to printing of the list then it is of no use.But it IS of use. The objects compEmployees is in scope.
    It has the list we want to print out.
    With logic:iterate:
    <table>
         <tr>
           <th>Number</th>
           <th>Employee</th>
         </tr>
         <logic:iterate name="compEmployees" property="totalEmps" id="emp">
              <tr>
                <td>
                  <bean:write name="emp" property="empNo"/>
                </td>
                <td>
                  <bean:write name="emp" property="empName"/>
                </td>
              </tr>
         </logic:iterate>
    </table>or alternatively with JSTL and c:forEach
    <table>
         <tr>
           <th>Number</th>
           <th>Employee</th>
         </tr>
         <c:forEach items="${compEmployees.totalEmps}" var="emp">
              <tr>
                <td>
                  <c:out value="${emp.empNo}"/>
                </td>
                <td>
                  <c:out value="${emp.empName}"/>
                </td>
              </tr>
         </c:forEach>
    </table>Cheers,
    evnafets

  • C:forEach and logic:iterate tags repeating elements of a collection

    I have an issue that makes absolutely no sense to me. Basically I am using struts, and I am returning a form that contains a List of customers. I am simply trying to iterate that list into a simple table for each customer. The end result will have rows for each table, but I tried to simplify this example.
    The only filter is that I don't want to display customers that don't contain any data that I care to display. In my dataset, there is only one customer that has any data that I care about, and that has been verified in the database and in the backend action feeding the struts page.
    I first attempted this with the c:forEach JSTL tag. What I saw was that the customers were just getting repeated. Instead of showing one table for each customer, it was repeating the tables for each customer equal to the size of the Collection. For example, there were *5* customers in the List, only customer C should have been set into a table, but the table for customer C was being repeated *5* times. I went into the backend code, and made sure the object being sent back to struts contained the correct number of records.
    I then tried the same thing using the logic:iterate Struts EL tag. This did exactly the same thing. Instead of one table for customer C, I had 5 tables, all for customer C.
    Frustrated, I then went back to just writing a basic scriptlet in the JSP, to iterate over the object returned from the struts action. When I did this, everything came back as normal. Only customer C met my conditional statement, and only customer C had a table created in the generated HTML.
    Now I must be missing something with how the JSTL tags are handling the iteration, so I wanted to post the code to see if anyone had any idea what I am doing wrong here.
    The JSP page is found below. As you can see, the first part is done as a scriptlet, and the last part is done with JSTL tags. Unless I am mistaken, the 2 approaches should produce the same result. Please let me know if I am missing something here.
    <%@ include file="/common/customConfig.inc"%>
    <%@ page import="java.util.Iterator,
        com.pw.cemp.webapp.common.forms.CempDocumentsForm,
        com.pw.cemp.webapp.common.views.CustomerView"%>
    Write table with straight scriptlets...
    <br />
    <br />
    <%
        CempDocumentsForm cdForm =
            (CempDocumentsForm) session.getAttribute("cempDocsForm");
        Iterator itCustomers = cdForm.getCustomers().iterator();
        while (itCustomers.hasNext())
            int idx = 0;
            CustomerView customer = (CustomerView) itCustomers.next();
            if (customer.getCemps() != null && !customer.getCemps().isEmpty())
    %>
            <table>
                <% if (idx == 0) { %>
                    <caption>
                        Customer CEMP Listing
                    </caption>               
                <% } %>
                <tbody>
                    <tr>
                        <td class="level1">
                            <%=customer.getName() %> -
                            <%=customer.getSapCustomerId() %>
                        </td>
                    </tr>
                </tbody>
            </table>
    <%      
            idx ++;
    %>
    <br />
    <br />
    Now try using JSTL...
    <br />
    <br />
        <logic:iterate name="cempDocsForm" property="customers" id="customer" indexId="index">
        <!-- <c:forEach items="${cempDocsForm.customers}" var="customer" varStatus="status"> -->
            <c:if test="${not empty customer.cemps}">           
            <table>
                <c:if test="${index == 0}">
                    <caption>
                        Customer CEMP Listing
                    </caption>
                </c:if>
                <tbody>
                    <tr>
                        <td class="level1">
                            <c:out value="${customer.name}" /> -
                            <c:out value="${customer.sapCustomerId}" />
                        </td>
                    </tr>
                </tbody>
            </table>
            </c:if>
        <!-- </c:forEach> -->
        </logic:iterate>
        <br />
        <br />The code above produced the following HTML. As you can see, the scriptlet did exactly what I wanted, it produced 1 table for the only company that met the conditional statement. The JSTL section repeated the table for that one company, equal to the number of items in my List.
    Write table with straight scriptlets...
    <br />
    <br />
            <table>
                    <caption>
                        Customer CEMP Listing
                    </caption>                           
                <tbody>
                    <tr>
                        <td class="level1">
                            FMP Test Company -
                            5
                        </td>
                    </tr>
                </tbody>
            </table>
    <br />
    <br />
    Now try using JSTL...
    <br />
    <br />
            <table>           
                    <caption>
                        Customer CEMP Listing
                    </caption>           
                <tbody>
                    <tr>
                        <td class="level1">
                            FMP Test Company -
                            5
                        </td>
                    </tr>
                </tbody>       
            </table>
            <table>
                <tbody>
                    <tr>
                        <td class="level1">
                            FMP Test Company -
                            5
                        </td>
                    </tr>
                </tbody>
            </table>
            <table>           
                <tbody>
                    <tr>
                        <td class="level1">
                            FMP Test Company -
                            5
                        </td>
                    </tr>
                </tbody>
            </table>
            <table>           
                <tbody>
                    <tr>
                        <td class="level1">
                            FMP Test Company -
                            5
                        </td>
                    </tr>
                </tbody>
            </table>
            <table>       
                <tbody>
                    <tr>
                        <td class="level1">
                            FMP Test Company -
                            5
                        </td>
                    </tr>
                </tbody>
            </table>
        <br />
        <br />Thanks in advance...
    Edited by: cdbyrd on Feb 28, 2008 4:22 PM
    Edited by: cdbyrd on Feb 28, 2008 5:12 PM

    Okay, it looks like I kept moving things around until I stumbled upon something. One thing to note is that I am using Tiles in my struts 1.2.9 application. I don't know if that has anything to do with it, but this is what I found.
    If you notice in my code, with the iteration tags, I had one active and one commented version of the tag. I kept flipping them around, thinking it was some kind of syntax problem or it was specific to either the logic:iterate or c:forEach tag.
    Well, as it turns out, when you comment something the way I did, I think the custom tag processor doesn't ignore the commented sections. I had things commented like the following.
        <logic:iterate name="cempDocsForm" property="customers" id="customer" indexId="index">
        <!-- <c:forEach items="${cempDocsForm.customers}" var="customer" varStatus="status"> -->Now I have done this many times in the past, and I have never noticed any adverse behavior. I guess it was just the correct situation here to make the problem come to the surface. As soon as I removed any comments on the JSP, the page started working as expected. I can't explain why it happens, I just know it happened.
    Does anyone out there have a good explanation for this, so I can put a reason to why I lost so much hair today? Also, does anyone have the proper way to comment out JSTL tags to keep them from being parsed?
    Thanks...

  • Problem in Iterating using logic:iterate tag

    Hi ,
    I am using <logic:iterate> tag to iterate through a list of contents.
    When the List size is 1222, all the Contents in the List are displaying properly.
    When the size execdes 1223, the JSP is not displaying properly.
    I am not getting any exception also.
    I have added try and catch. Still it is not showing any exception.
    When the size is more than 1300, Some contents are not displaying in JSP.
    Can any one provide some inputs, so that I can crack my issue.
    The JSP code :
              <logic:iterate id="someXXXX" property="someXXX" name="someXXX" indexId="count" scope="request">
              <tr>
    <td><html:text name="someXXXX" property="someXXXX"
                             size="50" maxlength="50" onchange="setDirty()" indexed="true"/> </td>               
    <td height="15" align="center"><html:checkbox property="someXXXX" name="someXXXX" indexed="true" onclick="setCheckboxFlag(this)" />               
                   <td width="4"> </td>               
              </tr>
              <html:hidden property="someXXXX" name="someXXXX" indexed="true" />
              </logic:iterate>
    Thanks,
    RamaKrishna

    get the records and store them in a collection. Store the collection in session. take the first 10 records as a subset and pass it to the iterate tag. use the hidden field to keep the last record number in the jsp. So when you first see the jsp the first 10 records will be shown and when user clicks for next records send the hidden field value to the server and take next 10 records as subset and pass it to iterate tag. This is how you can do this. but if you have thousands of records storing them in the session is not recommended. you can pull them directly from the database.

  • Urgent help on logic:iterate

    Dear all,
    I have a problem on logic:iterate and structs. Suppose I have EmployeeListAction to get the employees data as below :-
    employees = EmployeeData.getEmployees(getDataSource(request));
    request.setAttribute("employees", employees);
    In the EmployeeData file, sample codes are as below :-
    Employee employee = null;
    ArrayList employees = new ArrayList();
    employee = new Employee();
    employee.setName(firstname);
    employee.setEmail(Email);
    employee.setTimezone(Time_zone);
    employees.add(employee);
    In JSP, the way to call the employees data in the logic:iterate tag is as below :-
    <logic:iterate id="employee" name="employees" indexId="index" scope="request" property="com.convenxia.EmployeeListAction"
    <bean:message...>
    </logic:iterate>
    But it return errors which is as below :-
    javax.servlet.ServletException: Cannot find bean employees in scope session
    I have tried :-
    <logic:iterate id="employee" name="employees" indexId="index" scope="request"> or
    <logic:iterate id="employee" name="employees" indexId="index" scope="request" type="com.convenxia.Employee">
    But it still return errors which is as below :-
    javax.servlet.ServletException: Cannot find bean employees in scope session
    How to resolve it ?
    Please help me as soon as possible.
    Thank you.
    Cheers,
    yymae

    It look like you did not define or use bean.
    In program you do: request.setAttr || request.getSession().setAttr
    In jsp you then pick it up first:
    <jsp:useBean id="employees" class="...." scope=[request || session] (depends where you put it) />
    or for struts:
    <bean:define id="employees" scope="..[as above] toScope=[where you want to pick it up in iterate]"
    type="..." />
    then you should be able to use it safely in iterate tag.

  • How to select a drop down option item while using logic:iterate?

    I am using the following peice of code -
    {color:#808080}+String countrySelected = (String)request.getAttribute("country");+
    +....+
    +<logic:iterate id="countryVO" name="countryList" type="com.sa.biz.vo.airport.CountryVO">+
    +<%+
    +if (countrySelected != null){+
    String countrySel = countryVO.getCountryCode().toString();
    String selected = (countrySel.equalsIgnoreCase(countrySelected)) ? " " "Selected" : " ";+
    +%>+
    +<option value="<%=countryVO.getCountryCode()%>*<%=selected%>*"><bean:write property="countryName" name="countryVO"/></option>+
    +<%+
    +}+
    +%>+{color}
    {color:#808080}+</logic:iterate>+
    {color}{color:#000000}The drop down is a list of country names (value - country code, display text - country name) which gets populated from the database. I need to ensure that the countrySelected is the menu item which gets selected in the drop down.
    The expected option item is not rendered as selected when i run this code? Please help!!{color}

    <option value="<%=countryVO.getCountryCode()%>" <%=selected%>>Apply the above change which should help you out on the same. :)
    REGARDS,
    RaHuL

  • Html:select inside logic:iterate

    hi,
    I am having a string type corresponding to the select attribute in my form bean. Since this select tag is inside the logic:iterate all the names of the select boxes are same. i.e myLabel in this context. So, how can i set the value to select box. do i need to change the data type for labelValue in form bean.
    my form bean is given below:
    here the listTotal is the total of the combo and listValue is the individual combo
         public ArrayList listTotal;
         public Collection getListTotal()
              return (Collection)listTotal;
         public void setListTotal(ArrayList total)
              this.listTotal = total;
         public ArrayList listValues;
         public void setListValues(ArrayList values)
                   this.listValues = values;
         public ArrayList getListValues()
              return  listValues;
                         String myLabel;
         public String getMyLabel()
         return myLabel;
         public void setMyLabel(String myLabel)
         this.myLabel = myLabel;
    And i m setting the values in the action class
              ArrayList listTotal = new ArrayList(1);
              ArrayList listValues = new ArrayList();
              listValues.add(new LabelValueBean("k1", "Value1"));
              listValues.add(new LabelValueBean("k2", "Value2"));
              listValues.add(new LabelValueBean("k3", "value3"));
              listTotal.add(listValues);
              listValues = new ArrayList();
              listValues.add(new LabelValueBean("l1", "Value4"));
              listValues.add(new LabelValueBean("l2", "Value5"));
              listValues.add(new LabelValueBean("l3", "value6"));
              listTotal.add(listValues);
              listValues = new ArrayList();
              listValues.add(new LabelValueBean("m1", "Value7"));
              listValues.add(new LabelValueBean("m2", "Value8"));
              listValues.add(new LabelValueBean("m3", "value9"));
              listTotal.add(listValues);
              employeeForm.setListTotal(listTotal);
    jsp code
    <logic:iterate id="listValues" name="EmployeeForm" property="listTotal" indexId="index">
    <tr><td>
    <html:select property="myLabel" >
    <html:options collection="listValues" labelProperty="label" property="value"/>
    </html:select>
    </logic:iterate>

    hi,
    instead of having it as a array i thought of going for an array list so that the manipulation would be much easier. ok here is my code.
        //This is the array list for names of the drop downs.
        private ArrayList selectedList;
        public ArrayList getSelectedList()
            return selectedList;
        public void setSelectedList(ArrayList pselectedList)
           this.selectedList = pselectedList;
        public ListValueVO getSelected(int index)
           return (ListValueVO) selectedList.get(index);
        }I have already mentioned in my previous posts that i have 3 lists in my form bean. One list for individual combo box. Another list for total number of combo boxes. The third list for the names of the combo boxes. Pls let me know whether i m going in the correct direction or not.

  • I am not able to use logic iterate to print values in tables

    hi ,
    Any one plz help me in this..
    i am using struts 1.2.i have values to be displayed in table in an
    ArrayList.for example emp_id one ArrayList.
    emp_name another ArrayList.i want to display this in a jsp page.
    i have these values in ActionForm getter setter method as
    public void setname(ArrayList<String> a1){ 
        this.a1=a1;
      public ArrayList<String> getname(){
        return this.a1;
    public void setname(ArrayList<String> a2){ 
        this.a2=a2;
      public ArrayList<String> getname(){
        return this.a2;
      }to be displayed in jsp page
    as
    emp_ id emp_name
    1 san
    2 jay
    etc
    plzzz hepl me.thanks in advance.........

    Opps,Was too late to reply... :(
    sanjay_gates wrote:
    hi ,
    Any one plz help me in this..
    i am using struts 1.2.i have values to be displayed in table in an
    ArrayList.for example emp_id one ArrayList.
    emp_name another ArrayList.i want to display this in a jsp page.
    i have these values in ActionForm getter setter method as
    public void setname(ArrayList<String> a1){ 
    this.a1=a1;
    public ArrayList<String> getname(){
    return this.a1;
    public void setname(ArrayList<String> a2){ 
    this.a2=a2;
    public ArrayList<String> getname(){
    return this.a2;
    }to be displayed in jsp page
    as
    emp_ id emp_name
    1 san
    2 jay
    etc
    plzzz hepl me.thanks in advance.........Well first thing is that you need to right Convensions.
    public void setName(ArrayList<String> a1){ 
         this.a1=a1;
       public ArrayList<String> getName(){
         return this.a1;
       } and try to iterate it in the below fashoin.
    <logic:iterate id="varString"  name="formBean" property="name">
        <bean:write property="name"/><br/>
    </logic:iterate>Hope this might help :)
    REGARDS,
    RaHuL

  • Problem in using logic:iterate in struts

    Hello all,
    I have developed 1 application using struts.I am getting this error in my JSP.I have used logic:iterate.I am able to see the list of topics in my JSP but I am getting error when I am clicking on the hyperlink.This is the error.Please help me.Any help will be highly appreciated.Thanx in advance.
    ApplicationDispatcher[TGMC_DB1-2009] PWC1231: Servlet.service() for servlet jsp threw exception
    javax.servlet.jsp.JspException: Cannot find bean: "topic_list" in any scope
    at org.apache.struts.taglib.TagUtils.lookup(TagUtils.java:935)
    at org.apache.struts.taglib.logic.IterateTag.doStartTag(IterateTag.java:232)
    at org.apache.jsp.viewThreads_jsp._jspService(viewThreads_jsp.java from :121)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:93)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:470)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:364)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
    at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
    at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
    at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:853)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:703)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:542)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:474)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:366)
    at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)
    at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:263)
    at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:398)
    at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:318)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:241)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
    at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:718)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
    at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
    at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:288)
    at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
    at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
    at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:270)
    at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
    at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
    at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
    at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:339)
    at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:261)
    at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:212)
    at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
    at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
    StandardWrapperValve[action]: PWC1406: Servlet.service() for servlet action threw exception
    javax.servlet.jsp.JspException: Cannot find bean: "topic_list" in any scope
    at org.apache.struts.taglib.TagUtils.lookup(TagUtils.java:935)
    at org.apache.struts.taglib.logic.IterateTag.doStartTag(IterateTag.java:232)
    at org.apache.jsp.viewThreads_jsp._jspService(viewThreads_jsp.java from :121)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:93)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:470)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:364)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
    at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
    at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
    at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:853)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:703)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:542)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:474)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:366)
    at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)
    at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:263)
    at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:398)
    at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:318)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:241)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
    at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:718)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
    at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
    at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:288)
    at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
    at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
    at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:270)
    at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
    at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
    at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
    at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:339)
    at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:261)
    at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:212)
    at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
    *//Action class*
    package com.myapp.struts;
    import java.io.IOException;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import org.apache.struts.action.Action;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    import java.util.ArrayList;
    public class DiscussionForumViewAction extends Action {
      public ActionForward execute(ActionMapping mapping,
        ActionForm form,
        HttpServletRequest request,
        HttpServletResponse response)
        throws IOException, ServletException
          String target = new String("success");
            try
             ArrayList TopicList = null;
             TopicList= Discussion_Forum.getTopics();
             request.setAttribute("topic_list",TopicList);
            catch(Exception ex)
                System.out.println(ex.getMessage());
          return (mapping.findForward(target));
    *// jsp*
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <%@page contentType="text/html" pageEncoding="UTF-8"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
    <html>
        <head>
        </head>
        <body>
            <html:form action="/view_topic.do">
            <br><br><br>
    <center><h2><u>Discussion Forum</u></h2></center>
    <br><br>
            <div align="center">
                  <html:errors />
                <table border="1" cellspacing="0" cellpadding="0">
                                <thead>
                                 <tr>
                                    <th>Forum</th>
                                    <th>Topic/Messages</th>
                                   <th>Last Post</th>
                                 </tr>
                                </thead>
                                <tbody>
                                    <logic:present name="topic_list" scope="request">
                                      <logic:iterate id="TopicForm" name="topic_list">
                                        <tr align="left">
                                          <td>
                                             *<a href="get_threads.do?topic_id=<bean:write name="TopicForm" property="topic_id"/>"><font color="#336699">     <bean:write name="TopicForm" property="topic_name"/></font></a>*
                                        </td>
                                        <td>
                                        <bean:write name="TopicForm" property="no_of_threads"/>
                                       </td>
                                       <td>
                                       <bean:write name="TopicForm" property="last_post" />
                                      </td>
                                    </tr>
                                </logic:iterate>
                            </logic:present>
                     </tbody>
               </table>
            </div>
        </html:form>
    </body>
    </html>
    *//struts config*
        <action path="/view_topic"
                   type="com.myapp.struts.DiscussionForumViewAction"
                   name="TopicFormBean"
                   scope="session"
                   validate="true"
                   input="/Discussion_forum.jsp">
                   <forward name="success" path="/Discussion_forum.jsp" />
                   <forward name="failure" path="/welcomeStruts.jsp" />
           </action>
    *//formbean*
    package com.myapp.struts;
    import javax.servlet.http.HttpServletRequest;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionMapping;
    public class TopicFormBean extends ActionForm {
      protected String topic_name;
      protected String description;
      protected Integer no_of_threads;
      protected String last_post;
      protected Integer topic_id;
        public String getTopic_name() {
            return topic_name;
        public void setTopic_name(String topic_name) {
            this.topic_name = topic_name;
        public String getDescription() {
            return description;
        public void setDescription(String desc) {
            this.description = desc;
         public Integer getNo_of_threads() {
            return no_of_threads;
        public void setNo_of_threads(Integer no_of_threads) {
            this.no_of_threads = no_of_threads;
        public String getLast_post() {
            return last_post;
        public void setLast_post(String last_post) {
            this.last_post = last_post;
         public Integer getTopic_id() {
            return topic_id;
        public void setTopic_id(Integer topic_id) {
            this.topic_id = topic_id;
          }

    Thanx Praveen,
    I have already googled this error.I found many people have already posted this problem.But my problem is different.I am getting error only when clicking on hyper link otherwise that arraylist is displaying result on jsp.
    I have also gone through this link
    http://blog.smartlogicsolutions.com/2007/06/12/struts-11-problems-with-logiciterate-tags-and-cannot-find-bean-xxx-under-any-scope/
    It talks about :-
    1) using logic:present tag if your arraylist can be null.
    2) Take care that getter setter are properly written.. I mean there are no spelling mistakes.
    3)arraylist is set in request scope.
    4)I have also included the necessary taglibs.
    I have confirmed all these things.Please help me.I am pretty new to java.Thanx.
    Neha

  • JSP Compile Error when using dynamic ID in logic:iterate and bean:size

    Hello,
    I try to create a dynamic table with logic:iterate and bean:size tag. Dynamic means the attributes are written by scriptlet. Eg.:
    <logic:iterate id="customerBean" name="<%= formName %>"  property="<%= propertyName%>" length="<%= sRowSize%>">When I replace the id Attribute with propertyName I get compile errors, such as
    the compiler doesn't know the value at runtime:
    Unable to compile class for JSP An error occurred at line: 179 in the jsp file: /pages/formContent.jsp Generated servlet error: _newCustomer.java:1046: Missing term. java.lang.Object <%= propertyName %> = null; ^
    Whats wrong ?
    Thanks for your help

    Solution: don't use a runtime expression for the id attribute.
    The id attribute is used to declare
    - an attribute in scope
    - a scriptlet variable on the page
    These are only available for the duration of the <logic:iterate> tag
    The "id" is only used in your programming. You don't need to make it dynamic.

Maybe you are looking for

  • Library name compatibility 32/64 bit and across platforms

    Hi all, I have a numerical C library which I wish to link to using JNI. The binary will be shipped in the jar file to keep everything "clean" for the client. Unfortunately the SUN System.mapLibraryName method is completely useless when it comes to bu

  • Connection navigator does not appear in new install on Win XP

    I am trying to install SQL Developer as part of a class project on a Win XP machine. My problem When I launch sqldeveloper.exe, the start page appears but not the connection navigator pane. I do not have Oracle installed. I am trying to connect with

  • Version control bug

    JDev Team, a) The candidates tab of pending changes window lists the "JDeveloper project" files although I have "**/*.jpr" added to global ignore list. b) Incoming tab of pending changes window does not bring in changes checked into version control r

  • Where is the administrative user data stored?

    Hi I am trying to implement a simple user management application in an weblogic server (10.3.2). The user data is stored in an oracle database and the SQLAuthenticator is configured correctly. Everything works fine, the user gets authenticated, creat

  • Aperture not recognizing keywords for smart album

    Friends, I've set up a smart album that contains images with a particular keyword. The smart album contains family pictures and I use it for my screensaver. I've done this for several years without incident. Today, I noticed that the album only conta