I need to pass a request parameter from one JSP to another JSP page like this:
<a href="cv.jsp?type=alaacv">alaa</a>
However, when I try to access it as below, it doesn't print anything.
<c:set var="selectedCV" value="${type}" scope="request" />
<c:out value="${selectedCV}" />
How is this caused and how can I solve it?
You need to access it by
${param}
which is an implicit EL object referring to the request parameter map (which is actually aMap<String, String>
; if you need theMap<String, String[]>
for multi-valued parameters, use${paramValues}
instead).The
${param.type}
basically resolves torequest.getParameter("type")
.You can also just do as below without the need for
<c:set>
:See also: