简体   繁体   English

JSP中包含多个参数

[英]Multiple Params in JSP Include

This line: 这一行:

/${initParam['webinf']}${initParam['test']}header.jsp

Prints out: 打印出来:

/WEB-INF/test/header.jsp and if I copy this into: /WEB-INF/test/header.jsp ,如果我将其复制到:

<%@ include file="/WEB-INF/test/header.jsp" %> it works perfectly. <%@ include file="/WEB-INF/test/header.jsp" %>它完美无缺。

However, if I use the first line of code directly in the statement like this: 但是,如果我在语句中直接使用第一行代码,如下所示:

<%@ include file="/${initParam['webinf']}${initParam['test']}header.jsp" %>

I get the error: 我收到错误:

Sun Feb 16 15:03:56 GMT 2014: org.apache.jasper.JasperException: /WEB-INF/test/index.jsp (line: 10, column: 9) File "/${initParam['webinf']}${initParam['test']}header.jsp" not found

You should use 你应该用

  <jsp:include page="..." /> 

This will evaluate JSP EL in "..." . 这将在"..."评估JSP EL。

Some more info here Include another JSP file 这里有更多信息包括另一个JSP文件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM