If you're using a JSP 2.0 engine, the Expression Language is always preferred over scriptlets.
If not, you could use the ternary operator in a scriptlet expression:
I also use xhtml rules so I'd opt for selected="selected" as the attribute. But that's up to you.
Oh, and it's not really a "combo box". I'm not sure why so many people call it that. A "combo box" is a desktop control that allows either selection from a dropwdown list or typing a value into the control. That's where "combo" comes in. HTML does not provide for this type of control. You'll appear less of a newbie if you call it a "select element" or "dropdown" or "droplist". [ November 09, 2006: Message edited by: Bear Bibeault ]
Originally posted by Bear Bibeault: You'll appear less of a n00b if you call it a "select element" or "dropdown" or "droplist".
Bear Bibeault, Welcome to JavaRanch!
In an effort to help you get the most from our forums, we've compiled a list of tips for asking questions here. You can find the list in our FAQ section here. In particular please see: UseRealWords
Abbreviations such as "u" or "ur" in place of "you" and "you are" or "you're" confound language translation software making it hard for our non-English speaking members to read your posts. "n00b" is not a word in the English language.
Again, welcome to JavaRanch and good luck with your question. -Ben
[ November 09, 2006: Message edited by: Ben Souther ]