开发者

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="/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: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>.


Use ${param.type} instead of {$param.type}, if this does not work use param tag:

<jsp:include page="/adminadvertisement"> 
    <jsp:param name="type" value="${param.type}"/>
</jsp:include>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜