سؤال

I am working on a web project using jsp and custom framework which was designed like 12 years ago. we have our custom taglibs as well. i am trying to use the returned value of one taglib as a parameter to another taglib something like below in code:

<ta:GetName  id="<ta:GetID lastName='abc' />" />

but its not working, it is passing

<ta:GetID lastName='abc' />

in the parameter not the returned value of the tag GetID. is it even possible what i am trying to do if yes how do i do it.

Thanks for the help in advance.

هل كانت مفيدة؟

المحلول

You can't. You'll have to modify the GetId tag so that it stores the result into an attribute instead of printing it to the JSP writer, just like many JSTL tags do:

<ta:GetID lastName="abc" var="theId"/>
<ta:GetName id="${theId}" />
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top