Hi, everyone.

This is my first post so I will try to make it short. I am trying to use the logic:iterate and html:multibox. I found what I thought was a good example through a google search, but I just can't get it to work.

Here is the exception I get: javax.servlet.ServletException: Cannot find bean unit in any scope I understand the error, but don't know how to fix it.

The example I am following said to setup the tags as follows:

<logic:iterate id="unit" property="bannerUnits">
   <html:multibox property="selectedUnits">
      <bean:write name="unit" property="unitID"/>
   </html:multibox>
      <bean:write name="unit" property="name"/>
</logic:iterate>

My form for the jsp in the struts-config.xml is bannerFeedForm. bannerFeedForm has a bannerUnits array of the type Unit and a selectedUnits array of the type String. I populate the bannerUnits array from a db query in the action. If you need the form code or the relevant action code, let me know.

I believe my problem is that the id attribute of iterate is looking for a Unit bean in the page scope. However, the only bean in scope at the time is the bannerFeedForm. I figure I am missing something here, but am not sure what. I tried the following changes with the same results, of course.

<logic:iterate id="unit" name="bannerFeedForm" property="bannerUnits">
   <html:multibox name="bannerFeedForm" property="selectedUnits">
      <bean:write name="unit" property="unitID"/>
   </html:multibox>
      <bean:write name="unit" property="name"/>
</logic:iterate>

Should id be set to something else? If not, how do i get the needed bean in scope? In all the programming up to now we use request.setAttribute to pass information to the jsp.

I am really a newbie at this and can't spend much more time trying to get it to work. Another programmer suggested just hardcoding all the checkboxs, but I hate hardcoding something when I know I should be able to do it dynamically. Any help to avoid this would be appreciated.

Al


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

Reply via email to