Calling a custom JSP tag from JSTL tag

☆樱花仙子☆ 提交于 2019-11-30 16:12:41

问题


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:


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


来源:https://stackoverflow.com/questions/3785280/calling-a-custom-jsp-tag-from-jstl-tag

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!