为什么 request.getParameter("...") 没有在 JSP 中的 <c:out> 标签中求值?

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

为什么请求对象 getParameter 方法不像 param.property 那样工作?

这不起作用:

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

但这行得通:

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

有什么区别?为什么请求对象不可访问?

request 在 JSP 中隐式可用,并且它是 HttpServletRequest。它不起作用,因为无法评估您的表达式。 param 是 EL 用于评估来自 URL.

的参数的不同键

根据 Aaron Maenpaa 对 Method calls in EL 的回答,JSP 表达式语言旨在保持服务器的表示逻辑计算轻量级。