从JSTL标记调用自定义JSP标记 [英] Calling a custom JSP tag from JSTL tag

查看:114
本文介绍了从JSTL标记调用自定义JSP标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从JSTL代码< c:url> 调用我的自定义代码。
由于引号,自定义标记显示为字符串而不是标记。
我可以在这里使用转义字符吗?

I'm trying to call my custom tag from the JSTL tag <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"/>

这篇关于从JSTL标记调用自定义JSP标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆