a.valchev a.valchev - 9 days ago 9
Java Question

JSP - Why does request.getParameter("...") is not evaluated in <c:out> tag

Why request object

getParameter
method does not work like
param.property


Does not work

<c:out value="${request.getParameter('term')}" />


Works

<c:out value="${param.term}" />


What is the difference? Why the request object is not accessible?

Answer

request is implicitly available in JSP, and it's HttpServletRequest. It doesn't work because your expression can't be evaluated. param is different key used by EL to evaluate parameters from URL.