After submitting data in the HTML from, a servlet adds these data to my DB and forwards a result message to a JSP page. I want to retain the initially submitted values in th
You could access single-value request parameters by ${param}
.
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
...
...
...
Do note that JSTL's fn:escapeXml()
is necessary in order to prevent XSS attacks. See also XSS prevention in JSP/Servlet web application.
You could access multi-value request parameters by ${paramValues}
and EL 3.0 streams.
v == 'a').get() ? 'checked' : ''} />
v == 'b').get() ? 'checked' : ''} />
v == 'c').get() ? 'checked' : ''} />
...