Displaying values in html:option tag dynamically

Posted on 2006-05-01
Last Modified: 2008-03-10
Hi Experts,

This apprently gives syntax error and it is the following line.(If I switch to any string, it works.)

value="<bean:write name="providerListData" property="prnme" />"

I need to display prnme and store prnme, so value attribute and inside of option should be the same. This is what I did.

from java code
if(session.getAttribute("providerList") != null)

from jsp file
<logic:present name="providerList">
     <logic:iterate id="providerListData" name="providerList" >
         <logic:present name="providerListData">
            <html:option value="<bean:write name="providerListData" property="prnme" />">
                  <bean:write name="providerListData" property="prnme" />

What is wrong with this anyway?

Question by:dkim18
    LVL 23

    Expert Comment

    try this

    value="<bean:write name='providerListData' property='prnme' />"

    Author Comment

    what is the difference? I already tried that.
    LVL 23

    Accepted Solution

    hey i didn't notice you nedd to use html:select inside which you use a html:option.

    check out.
    LVL 10

    Assisted Solution

    You *can't* mix up two struts tags like that. It just won't work.

    You'll either have to use JSTL tag or a scriptlet to do that.

    Better still, use the HTML tag with EL support from struts.

    Then, you can do something like this:


    Also, use the <html:options> tag within a <html:select> tag as sivapsk suggested.


    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    Suggested Solutions

    In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
    Disabling the Directory Sync Service Account in Office 365 will stop directory synchronization from working.
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now