In my JSP I have a dropdownlist and a submit button when clicking the submit button I lose the value already selected in my list.
I am using the jstl because i need to construct other table corresponding the value selected in my list.For that I must call a submit button but the problem; it reset the value selected
I want to know if there is a way to save the value selected in my list even I click a submit button.
I work with JSP and eclipse environment.
Thank you for your help.
You need to preset the inputs with the request parameter values. You can access parameter values in EL by
${param.name}. In case of dropdowns rendered by HTML<select>element, you need to set theselectedattribute of the HTML<option>element in question. You can make use of the ternary operator in EL to print theselectedattribute whenever the option value matches the request parameter value.Basic example: