This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I know I've seen this question answered somewhere before, but for the life of me I can't find it. Or I am not asking Google the correct question.
I have an HTML listbox from which a user can select an option. Some of the options have two or more words in them, so for instance, if my listbox held a list of bands, it might have Kiss, ACDC, The Clash, Violent Femmes, The Sex Pistols in the list. If my user is interested in learning about The Clash, the would select that from the listbox, and then click submit.
In my servlet, I use String band = request.getParameterValues("band");. I would expect band to hold The Clash, but instead it only holds The.
The API tells me that there is a getParameterValues that returns multiple values, but that appears to be only for instances like multiply selected checkboxes. getParameterNames returns an enumerator.
It would be simple enough to append the words with an underscore so that I had The_Clash. Although a simple fix, I am reasonably sure I saw some way to do this without doing any funky appending.