Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Using C:out in custome tag  RSS feed

 
Montano Mazvik
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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="<cut 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 "<cut 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 ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66203
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 <cut>". You should be careful how you use that word.

value="<cut 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 <cut> provides, you can just use the EL expression without the <cut>. 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 ]
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!