File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Custom TagLib Insert Head Info Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Custom TagLib Insert Head Info" Watch "Custom TagLib Insert Head Info" New topic
Author

Custom TagLib Insert Head Info

Chad Mosfet
Greenhorn

Joined: Jan 22, 2003
Posts: 2
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


BEA WebLogic 7.0/Tomcat 4.1.18<br />Windows 2000 Server SP3/SQL Server 2000
mounika paruchuri
Greenhorn

Joined: Feb 12, 2002
Posts: 26
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

Joined: Jan 22, 2003
Posts: 2
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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Custom TagLib Insert Head Info
 
Similar Threads
setting DOM properties
security in jsp
JavaScript function in HTML body
JSTL EL language not resolving
Question on Tag files