I have several similar structures on the page. Each of the structure consists of a header and several checkboxes. In the java code I am creating a map for each set of data and pass them into the service.
On the main jsp page I get the service and can read these maps keys and values. But this way I will repeat the same code many times. So, I have to create something that looks like a function with a parameter, and that something will insert pieces of html code into the main page.
I can call included jsp file with a simple string parameter as here.
<jsp:include page="groop_checkbox_with_header.jspf">
<jsp:param name="mapName" value="investQuestionsExperience"/>
</jsp:include>
....
"${param.mapName}" - for use in the included jsp file
But I cannot set a parameter to a map. I could set a parameter to a map name and to get the map from the service/request/session using the map name inside the included jsp. But how to get the service/request/session in the called jsp file? It seems, I have to send a parameter with some non-trivial content.
But how?
I could use jsp tag
instead of include
. But the problems remains practically the same.
Please, notice, that I am using pure JSP without JSTL <c: >
tags and I cannot use the last ones.