[英]how to use variable in page attribute of jsp include tag?
how to use variable in page attribute of jsp include tag ? 如何在jsp include标签的page属性中使用变量?
<jsp:include page="/adminadvertisement?type=c80&action=showall" />
I want to insert a variable passed as parameter in page attribute .Something like 我想在页面属性中插入作为参数传递的变量。
<jsp:include page="/adminadvertisement?type={$param.type}&action=showall" />
Use <jsp:param>
(and fix your incorrect EL expression , it should follow ${}
syntax) 使用<jsp:param>
(并修复您不正确的EL表达式 ,它应遵循${}
语法)
<jsp:include page="/adminadvertisement">
<jsp:param name="type" value="${param.type}" />
<jsp:param name="action" value="showall" />
</jsp:include>
However, since it's to be derived from the request parameter, you should be able to use ${param.type}
inside the included JSP page page directly without passing it as <jsp:param>
. 但是,由于它是从request参数派生的,因此您应该能够直接在随附的JSP页面页面内使用${param.type}
,而不${param.type}
其作为<jsp:param>
传递。
Use ${param.type}
instead of {$param.type}
, if this does not work use param
tag: 使用${param.type}
代替{$param.type}
,如果这不起作用,请使用param
标记:
<jsp:include page="/adminadvertisement">
<jsp:param name="type" value="${param.type}"/>
</jsp:include>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.