简体   繁体   English

从JSTL标记调用自定义JSP标记

[英]Calling a custom JSP tag from JSTL tag

I'm trying to call my custom tag from the JSTL tag <c:url> . 我正在尝试从JSTL标记<c:url>调用我的自定义标记。 Because of the quotes, the custom tag is shown as a string instead of a tag. 由于引号,自定义标记显示为字符串而不是标记。 Can I use an escape character here? 我可以在这里使用转义字符吗?

<img align="left" src="<c:url value='/getFile/getfile?<myTag:getValue type="web"  name="person" />'/>" alt="person" title="person" width="55" height="70"/>

You'll have to assign the output of your custom tag to a temp variable first and then use it 您必须先将自定义标记的输出分配给临时变量,然后再使用它

<c:set var="urlquerystring"><myTag:getValue type="web" name="person" /></c:set>

<img align="left" src="<c:url value='/getFile/getfile?${urlquerystring}'/>" alt="person" title="person" width="55" height="70"/>

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

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