• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Using Custom tags inside HTML or Scriptlet

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Bite back!
 
reply
    Bookmark Topic Watch Topic
  • New Topic