I'll provide some information at the end.  If you have any more
questions about this, please ask on the "struts-user" list.

> -----Original Message-----
> From: edgar [mailto:edgar@;blue-moose.net]
> Sent: Wednesday, November 06, 2002 8:20 AM
> 
> My apologies for not posting more information.  This was such a basic
> issue I assumed that someone would know about it.  The real 
> question is
> are people actively doing such things with the JSTL / Struts
> combination?
> 
> As you can see I have also modified some of the tags so I assumed
> someone would assume I botched them.  In this trace I have modified
> NestedWriteTag (the only change was to make it a subclass of my
> WriteTag, which I have heavily modified) but that has not 
> been executed.
> 
> A sample piece of code which fails.
> 
> <html:form action='myaction' method='post'>
>       <nested:iterate property='myarraylist'>
>               <c:set var="myChoiceValue" scope='request'>
>                       <nested:write property='myNestedChoiceValue'>
>               </c:set>
>               <c:set var="myChoiceLabel" scope='request'>
>                       <nested:write property='myNestedChoiceLabel'>
>               </c:set>
>               <nested:select property='myChoice'>
>                       <html:options 
>                               name='<%=(String)
> request.getAttribute(myChoiceValue)%>'
>                               labelName='<%=(String)
> request.getAttribute(myChoiceValue)%>'
>                       />
>               </nested:select>
>       </nested:iterate>
> </html:form>

This is why showing the exact code sample is important.  Part of your
problem is obvious from this code sample.

The result of the "c:set" tag is not a JSP scripting variable, just a
scoped attribute.  That is, you can't reference "myChoiceValue" as a
scripting variable as you're doing.

This sort of thing would be easier if you used the Struts-EL library, as
you can do something like this:

  <html-el:options name="${myChoiceValue}" labelName="${myChoiceLabel}"
/>

Note that I changed the scoped attribute you're referencing for the
"labelName" attribute to what you probably meant, being "myChoiceLabel"
instead of "myChoiceValue" as you had.

--
To unsubscribe, e-mail:   <mailto:struts-dev-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-dev-help@;jakarta.apache.org>

Reply via email to