为什么jsp:include参数不可见

| 关于访问jsp:param值,我有与此海报完全相同的基本问题;完全按照他的榜样对我不起作用。通过jsp:include传递的参数似乎未显示在包含的文件中。我的设置有什么特别之处吗? 呼叫者:
<div>
    <jsp:include page=\"../../../common/callee.jsp\">
        <jsp:param name=\"justinVar\" value=\"primary\" />
    </jsp:include>      
</div>
callee.jsp:
<i>method 1: [</i><b><%= request.getParameter(\"justinVar\") %></b><i>]</i>
<p/>
<i>method 2: [</i><b>${param.justinVar}</b><i>]</i>
<p/>
<i>method 3: [</i><b>${justinVar}</b><i>]</i>
<p/>
最终输出:
method 1: [null]

method 2: []

method 3: [] 
更新: 以下变通办法确实有效,这似乎是错误的,但也许有效的事实揭示了某些无效的方法。
<c:set var=\"justinVar\" value=\"justinVARisHere\" scope=\"request\" />
<jsp:include page=\"../../../common/callee.jsp\" />
    
已邀请:
要解决该问题,请尝试通过在EL中打印
${param}
或在Java代码中打印
HttpServletRequest#getParameterMap()
来调试/探索整个地图。它必须提供有关地图实际包含内容的见解。     
对。 在过去大约一个小时内,我遇到了类似的问题,并且为我的案件找到了解决方案。 我有index.jsp,并试图将news.jspf包含在index.jsp中的jsp参数文本中 它没有用。它只是将news.jspf EL显示为普通文本。 我将包含的文件扩展名从.jspf更改为.jsp,它解决了该问题。 我正在使用Eclipse,这可能是因素也可能不是因素。 祝好运     
我已经找到了生成的Java源代码,它看起来很合理。发生以下两种情况之一:org.apache.jasper.runtime.JspRuntimeLibrary.URLEncode弄乱了变量名称,或者所使用的类加载器将JspRuntimeLibrary解析为驱动该Web应用程序的另一个实例。
// caller.jsp ....
org.apache.jasper.runtime.JspRuntimeLibrary.include(request, response, 
  \"callee.jsp\" + ((\"callee.jsp\").indexOf(\'?\')>0? \'&\': \'?\') + 
  org.apache.jasper.runtime.JspRuntimeLibrary.URLEncode(\"justinVar\",
  request.getCharacterEncoding())+ \"=\" +
  org.apache.jasper.runtime.JspRuntimeLibrary.URLEncode(\"primary\", 
  request.getCharacterEncoding()), out, true
);
在Jasper的运行时内部,我们找到了这个宝石。尚不清楚这是问题所在,但是正在呈现的页面是defaultParent.jsp的jsp:include,尽管从defaultParent传递到jsp:include的jsp:params似乎也没有显示。
  958           // FIXME - It is tempting to use request.getRequestDispatcher() to
  959           // resolve a relative path directly, but Catalina currently does not
  960           // take into account whether the caller is inside a RequestDispatcher
  961           // include or not.  Whether Catalina *should* take that into account
  962           // is a spec issue currently under review.  In the mean time,
  963           // replicate Jasper\'s previous behavior
    
我Liferay Portlet中的这项工作
ParamUtil.getString(PortalUtil.getOriginalServletRequest(request), \"justinVar\")
    
如果请求被包装(即HttpServletRequestWrapper),则可能会通过过滤器发生此问题。  请参阅:当原始请求用HttpServletRequestWrapper包装时,jsp:param不再设置参数     

要回复问题请先登录注册