Greetingz Struts fanatics! ;)

The collection I want to use in my <html:options> is nested two levels deep
from the bean that is actually in scope (named 'database').  For example,
here's how I'm accessing the collection from JSP scriplet:

<% Collection users = database.getUsersTable().getUsers(); %>

Each 'User' bean in the collection as an "id" and "username" property, which
I want as key and label respectively, so I thought the following would work,
but it doesn't:

<html:select property="userId">
    <html:options
        collection="database.usersTable.users"
        property="id"
        labelProperty="username"/>
</html:select>

I get the following exception:

javax.servlet.ServletException:
Cannot find bean under name database.userstable.users

Even if I put my getUsers() method directly in the database bean, I still
get a message "... cannot find bean under name database.users".

So my guess is that <html:options> doesn't support bean nesting (in the form
of "bean1.bean2.bean3") as <logic:iterate> does...  Is that right?

The only thing that worked (but wasn't pretty) was to put a scriptlet at the
top of the page to take the nested users collection and put it directly as a
request attribute, and then refer to it from the options tag.

Thanks in advance for any advice...

Best regards,

        Mathieu Frenette
        Software Architect
        Freeborders Canada


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

Reply via email to