Originally posted by Thomas Knight:
My bean says the value is null while my request.getParameter says that it is empty string. Why? Which one is it? See code below. I have code before this that initializes the bean and stores the sex value in it.
if your your request.getParameter says if is an empty string then it would be an empty string.
regarding your bean it depends how you are calling setter of bean and what is intial value of variable sex in bean.
use some javascript to debug your problem.
before submitting the forms check the following
alert(document.document.forms[0].sex.selectedIndex);
alert(document.document.forms[0].sex.options[document.document.forms[0].sex.selectedIndex].value);
and also print the length of
out.println(request.getParameter("sex").length());
hope you get something to find the answer of your problem
[ October 23, 2004: Message edited by: Shailesh Chandra ]