For example (I hope people won't object to HTML in mail...):
The first time the jsp is run (there's no data in the request object), it acts as expected. Neither of the <OPTION> have the SELECTED attribute. The second time this page is loaded (by submitting the form) there is now request data, and the SELECTED attribute is correctly applied to the selected option. However, on the 2nd time the form is submitted, with the other option selected, BOTH <OPTIONS> end up with the SELECTED attribute!
How can this be? The code clearly says that only the option that was stored in the request object should have the selected attribute. I can't figure this out.
All of my <SELECT> widgets on this form (there's five of them) have this problem. In every case, no matter how many <OPTION> there are, I always end up with TWO of them having the SELECTED attribute.
I'm using Resin 1.1b3 as my Servlet/JSP engine, Apache 1.3.9 as my httpd, Solaris 2.7 on UltraSPARC as my os/server. I know that the parameters of the request object have the correct values, despite what shows up in the HTML the client sees, as I'm printing out the SQL query I'm building on the page each time it loads.
Here's the source, as seen from the client (IE5):
1. First time the page is loaded
<SELECT NAME="sortby">
<OPTION VALUE="ASC">ASC</OPTION>
<OPTION VALUE="DESC">DESC</OPTION>
</SELECT>
2. Second time through after submitting the form with DESC selected
<SELECT NAME="sortby">
<OPTION VALUE="ASC">ASC</OPTION>
<OPTION VALUE="DESC" SELECTED>DESC</OPTION>
</SELECT>
3. Third time, submitting the form but selecting the ASC <OPTION>
<SELECT NAME="sortby">
<OPTION VALUE="ASC" SELECTED>ASC</OPTION>
<OPTION VALUE="DESC" SELECTED>DESC</OPTION>
</SELECT>
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
