You cannot use a jsp tag as an attribute of another tag

    <html:option value="<bean:write name="element" property="id" />" >
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     <bean:write name="element" property="value" />
    </html:option>

In general you can use rt to get round this:

<bean:define id="the_id">
        <bean:write name="element" property="id" />
</bean:define>

<html:option value="<%the_id%>">
        <bean:write name="element" property="value" />
</html:option>

However, in you case there is no reason to use the jsp <html:option> over
simple html <option> tags. You can do anything you like with html tags as
the jsp compiler does nothing with them:

    <option value="<bean:write name="element" property="id" />" >
     <bean:write name="element" property="value" />
    <option>

Having said all that, keeping everything in one big data structure seems a
bit messy.

Wht not define a different session scope attribute for each "property", or
have a single hashmap of collections (id, value) in session scope, keyed on
"property"?

Paul


> -----Original Message-----
> From: Marc Tinnemeyer [mailto:[EMAIL PROTECTED]
> Sent: Thursday, April 22, 2004 3:39 PM
> To: [EMAIL PROTECTED]
> Subject: <html:option /> and co
> 
> 
> hi everybody,
> 
> I got a collection in session scope which contains a lot of properties
> that I want to use to fill comboboxes etc.
> 
> the objects stored in this collection look like:
> 
> id(int), property(string), value(string)
> 
> The propertyfield indicates where the object belongs to (eg. 
> country or
> os...).
> So in my JSPs I want to iterate through this collection an pick the
> objects belonging to the current combobox.
> That's the theory, practically there is s.th. that keeps me from doing
> this.
> 
> Here is what I did so far.
> 
> my collection is called "PROPERTIES".
> 
> 
> <html:select property="bundesland" size="1">
>  <logic:iterate name="PROPERTIES" id="element" >
>   <logic:equal name="element" property="property" value="bundesland">
>    <html:option value="<bean:write name="element" property="id" />" >
>     <bean:write name="element" property="value" />
>    </html:option>
>   </logic:equal>
>  </logic:iterate>
> </html:select>
> 
> 
> When I call that jsp, I receive the follwing error message "equal
> symbol expected" (which points at):  
> <html:option value="<bean:write name="element" property="id" />" >
>                                             ^^
> 
> So I replaced the doublequotes by singlequotes, which let the error
> disappear, while putting the whole string "<bean:write..." into my
> valuefield :-(
> 
> 
> Does anybody ever encountered a similar problem, and solved it or does
> somebody have an idea how to solve this, maybe even in a more 
> elegant way
> ?
> 
> Thanks in advance,
> 
> Kind Regards,
> Marc Tinnemeyer
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


**********************************************************************
Axios Email Confidentiality Footer
Privileged/Confidential Information may be contained in this message. If you are not 
the addressee indicated in this message (or responsible for delivery of the message to 
such person), you may not copy or deliver this message to anyone. In such case, you 
should destroy this message, and notify us immediately. If you or your employer does 
not consent to Internet email messages of this kind, please advise us immediately. 
Opinions, conclusions and other information expressed in this message are not given or 
endorsed by my Company or employer unless otherwise indicated by an authorised 
representative independent of this message.
WARNING:
While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted 
via electronic mail attachments we cannot guarantee that attachments do not contain 
computer virus code.  You are therefore strongly advised to undertake anti virus 
checks prior to accessing the attachment to this electronic mail.  Axios Systems Ltd 
grants no warranties regarding performance use or quality of any attachment and 
undertakes no liability for loss or damage howsoever caused.
**********************************************************************


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

Reply via email to