[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Displaying values in html:option tag dynamically

Posted on 2006-05-01
6
Medium Priority
?
328 Views
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)
                    session.removeAttribute("providerList");
...
...

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" />
             </html:option>
                      
          </logic:present>
      </logic:iterate>
</logic:present>
+++++++++++++++

What is wrong with this anyway?

thx
0
Comment
Question by:dkim18
  • 2
4 Comments
 
LVL 23

Expert Comment

by:Siva Prasanna Kumar
ID: 16582486
try this

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

Author Comment

by:dkim18
ID: 16582535
what is the difference? I already tried that.
0
 
LVL 23

Accepted Solution

by:
Siva Prasanna Kumar earned 500 total points
ID: 16582937
hey i didn't notice you nedd to use html:select inside which you use a html:option.

check out.

http://www.javalobby.org/articles/struts/
http://husted.com/struts/tips/006.html
0
 
LVL 10

Assisted Solution

by:radarsh
radarsh earned 500 total points
ID: 16584481
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:

value="${providerListData.prnme}"


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

________
radarsh
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I came across an unsolved Outlook issue and here is my solution.
Exchange administrators are always vigilant about Exchange crashes and disasters that are possible any time. It is quite essential to identify the symptoms of a possible Exchange issue and be prepared with a proper recovery plan. There are multiple…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

834 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