Calling a custom JSP tag from JSTL tag

2019-02-11 05:37发布

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"/>

1条回答
叼着烟拽天下
2楼-- · 2019-02-11 06:08

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"/>
查看更多
登录 后发表回答