• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

nested:iterate with array within array

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using Struts 1.3.8. I have a jsp with multiple included jsps. There are many input fields that are arrays and the user can click "addrow" and get an empty row for that field. All the "adds" with a single array work fine. I need an array of Paths that can each contain an array of segments. Adding a blank Path is working. But, I get the error of cannot find bean if I try to add a blank segment row. The code format that I used was copied from an existing app that allows users to update fields, but not add a new row. I am really stumped. I have not been able to find an answer to this. Any help would be appreciated. Thanks.
Below is snippets of code for the jsps, struts-config, classes.

11:57:41,713 - Servlet.service() for servlet jsp threw exception
javax.servlet.jsp.JspException: Cannot find bean: "pathDetailId[0].segmentDetailId" in any scope
at org.apache.struts.taglib.TagUtils.lookup(TagUtils.java:864)
at org.apache.struts.taglib.html.CheckboxTag.isChecked(CheckboxTag.java:151)
at org.apache.struts.taglib.html.CheckboxTag.doStartTag(CheckboxTag.java:124)
at org.apache.struts.taglib.nested.html.NestedCheckboxTag.doStartTag(NestedCheckboxTag.java:63)
at org.apache.jsp.dataPath_jsp._jspx_meth_nested_005fcheckbox_005f1(dataPath_jsp.java:822)
at org.apache.jsp.dataPath_jsp._jspService(dataPath_jsp.java:342)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)

JSP with multiple included jsps


 
Ranch Hand
Posts: 300
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sue,

Please use the code tag ..
Regards
Jatan
 
sue curt
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have this working now. I removed the name= from the inside iterate nested:text. I let struts determine the name. When I view the source, I can see that the name is path[0]segment[0].bandwidth, etc. So, I don't get the "can't find bean error". But, then I got index out of bounds on the beanUtil.populate getIndexedProperty. This occurs because it can't find the pathArray when returning from the action class after adding a blank segment row. I changed the scope in the struts-config to be session instead of request. It is correctly writting to the database and returns to the jsp with the correct data.
 
reply
    Bookmark Topic Watch Topic
  • New Topic