Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Custom TagLib Insert Head Info

 
Chad Mosfet
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a custom tag library that when I place it in the JSP page it prints out a button (image w/ a link). The button has associated javascript code with it. Is there a way to direct the output of the TagLib so the html written to display the button is added to the <body> section of the page (where the tag is inserted) while the javascript code is added into the <head> section? Is this possible? If so how?
thanks,
--chad
 
mounika paruchuri
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know if this logic of mine would work out for you but I had once the same problem and what I did was use the taglib to give me a button image(without link) and instead add the link and javascript code in the jsp page where I was displaying the button image.
Mounika
 
Chad Mosfet
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well I have the tag working. In the Tag Class I have two StringBuffers one contains HTML code the other contains javascript code. What I would like is to be able to write the HTML stringbuffer right where the tag is in the jsp and have the javascript stringbuffer write its contents into the <head> section of the jsp page. Right now it works like it is but doesn't produce the nicest html source. So is there anywhere to redirect the output of the tag class to various parts in the html structure??
thanks,
--chad
[ February 21, 2003: Message edited by: Chad Mosfet ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic