I'm remarkably bad at creating HTML components using the various
struts tag libraries. I understand the rest of Struts well but, when it comes to writing my
JSP pages, I'm much better at using raw HTML than Struts tags. As I'm currently working on my first Struts app, I'm learning as I go along.
Anyway, a co-worker of mine came to me with a problem she's having (we're both new to Struts and she's quite new to
Java, in general). Let me try to explain the situation.
In the form bean, she has a member variable which is, in itself, a collection of beans. So, she has a form bean which contains a member called status, which is a collection of beans that contain a label and a value - essentially it's a hash (she probably isn't yet comfortable enough with Java to use a hash but we pick our battles and I'll leave this one go for now). She wanted to print all of the values to her JSP so we got some code together that looks like this:
That little snippet gets us all of the status labels printed out in a nice row. That's fine, but it's the next part that gets me. We want to print out each of those labels as a radio button so that the user can select a new status. How do I do that? I've looked at the <html:radio> tag but I honestly can't make much sense of it. My goal would be to have HTML that resembles this:
Any ideas how I might accomplish that? Like I said, I'm pretty new to this whole Struts tag thing and, while I've been working on some back end stuff, my co-workers have been getting into this stuff. Obviously, I haven't had time to play with it myself so I'll simply concede to asking for help for the time being.
Thanks,
Corey