Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is it possible to use a tag w/in a tag with tag files?

 
Matt Raible
author
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to do something like this:

<tag:head><tag:js src="foo.js"/></tag:head>

However, when I use body-content="scriptless" in head.tag, it blows up. When I use body-content="tagdependent", "<tag:js src="foo.js"/>" is spit out w/o being evaluated.

Thanks,
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65115
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it blows up


Some details on the explosion might be helpful.
 
Matt Raible
author
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nevermind, I got it working - don't know what was causing the non-evaluation before.

I do have a new problem though - if I turn on trimSpaces in Tomcat's web.xml - all the lines spit out by my tag files are on the same line. With a regular JSP, line breaks are honored. Any ideas?

Thanks,

Matt
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65115
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, but why does it matter?
 
Matt Raible
author
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Bear Bibeault:
No, but why does it matter?


It doesn't matter for an aesthetics point of view, but web developers might get annoyed the output doesn't look like their input. It works fine on JSPs, just not on Tag files. I'm using Tomcat 5.0.25.

Matt
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65115
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Matt Raible:
but web developers might get annoyed the output doesn't look like their input


As the Dread Pirate Roberts once said "Get used to disappointment."

Seriously, worrying about what the output of a JSP looks like is really not a very valid concern.
[ August 23, 2007: Message edited by: Bear Bibeault ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic