• Post Reply Bookmark Topic Watch Topic
  • New Topic

Using Custom tags inside HTML or Scriptlet

 
Prassanna Srinivasan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Overlooking the fact that custom tags reduce the need for scriptlets in a JSP,

is there a way to use invoke a custom tag inside a scriptlet or within a HTML

tag?

for eg/. if I have a custom tag handler that prints out a static url, would it

be possible to invoke that tag inside lets say a HTML <img > tag where the

value for the src attribute would be provided by the custom tag at run time?

something like..<img src = "<prefix:someTag />" /> ??

Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Inside a scriplet? No. At least not in a container-agnostic manner.

HTML is just template text. In other words it has no semantic meaning to the JSP translator and thus you can embed custom tags within it without causing the translator to flip out.

Why didn't you just try it out and see what happened? That probably would've taken less time than typing your question.
 
Prassanna Srinivasan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bear,

Yeah.. I did try out about a million permutations..couldn't see any logical

way the container would translate the tag invocation within a scriptlet, but

just wanted to make sure I was not missing anything.

wouldnt be too nice to have my head bitten off when I say this to my boss now

would it?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bite back!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!