Search code examples
javajstljsp-tags

Why is request.getParameter("...") not evaluated in <c:out> tags in JSP?


Why does the request object getParameter method not work like param.property?

This does not work:

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

But this works:

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

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


Solution

  • 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.