Selected value for JSP drop down using JSTL
In HTML, the selected option is represented by the presence of the selected attribute on the <option> element like so: <option … selected>…</option> Or if you’re HTML/XHTML strict: <option … selected=”selected”>…</option> Thus, you just have to let JSP/EL print it conditionally. Provided that you’ve prepared the selected department as follows: request.setAttribute(“selectedDept”, selectedDept); then this should … Read more