I am using one JSP page for insert and update. When I am editing the page how can I set selected value to drop down where selected value will come from database. Provided that you've prepared the selected department as follows:.
Log In Sign Up. Join the Stack Overflow Community. Stack Overflow is a community of 7.
java - Set HTML dropdown selected option using JSTL - Stack Overflow
Join them; it only takes a minute: Selected value for JSP drop down using JSTL Ask Question. Any help is highly appreciable. BalusC k Provided that you've prepared the selected department as follows: How can I retain HTML form field values in JSP after submitting form to Servlet?
Then it that case I should have two request request. Did you face a problem while trying that?
Nope, it works like a charm. If you don't mind using jQuery you can use the code bellow: Uri 8 Thanks Uri, I will try this. This approach fails if JS is disabled. Uri Here how can I specify servlet class?
Because for my datatable I am using a servlet, I would specify another servlet controller for select component. Polppan do you mean how to refer to another Controller from you JSP page? I think this question should have a different post I think above examples are correct. I tried the accepted answer, it did not work.
Spring MVC dropdown box example
However the simple way to do it is below: Sandeep Kumar 21 7. You can try one even more simple: Sign up or log in StackExchange. Sign up using Facebook.
java - JSTL html select and options: cannot find bean under name - Stack Overflow
Thanks jsp drop-down-menu jstl retain share improve this question. MathOverflow Mathematics Cross Validated stats Theoretical Computer Science Physics Chemistry Biology Computer Science Philosophy more 3. Meta Stack Exchange Stack Apps Area 51 Stack Overflow Talent.