Forums Register Login

Using C:out in custome tag

+Pie Number of slices to send: Send
Hi there,

I have requirement to use <C:OUT inside value="" of my custom tag.

something like below.

<wda:input type="text"
name="directDebit"
value="<c:out value="${requestScope.VB.directDebit}"/>"
</wda:input>

but it give me exception

Attribute ${requestScope.VB.directDebit} has no value]

However when use same in normal input tag its working fine.

Please note that I am encoding the attribute contents in my tld if content doesn't start and ends with # I am returning the same content back. for e.g. if value="aaa" then same will be set in value attribute & value="#somekey#" then different value would be set.

Ideally speaking my tld should return back the current content which is "<c:out value="${requestScope.VB.directDebit}"/>" since it doesn't starts with # and the same should be taken care by JSTL.

I tried debugging but it's not even reaching my TLD code.

I am not sure what I am doing is correct, but I guess it should work somehow.

Please give my your inputs in fixing this problem
[ July 04, 2008: Message edited by: Bear Bibeault ]
+Pie Number of slices to send: Send
 

Originally posted by Montano Mazvik:
I have requirement to use <C:OUT inside value="" of my custom tag.

I'm sure your requirement doesn't say "use <c:out>". You should be careful how you use that word.

value="<c:out value="${requestScope.VB.directDebit}"/>"


You can't use an action (the correct term for "JSP tag") as the value of another JSP action.

If you don't need the escaping that <c:out> provides, you can just use the EL expression without the <c:out>. If you need the escaping, then you can use the JSTL's fn:escapeXml function.

However when use same in normal input tag its working fine.

HTML markup is just template text to the JSP and since it doesn't get processed on the server, you can do anything you like in it.
[ July 04, 2008: Message edited by: Bear Bibeault ]
What are your superhero powers? Go ahead and try them on this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1267 times.
Similar Threads
Expression Language in Taglibs
Custom Tag Parameters as values from other Custom Tags
Pass expression value to custom tag class?
Can a Custom Tag support jstl tag ?
jstl in tomcat 6.0
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 00:12:58.