It's not a secret anymore!*
The moose likes JSP and the fly likes Drop-down menus with custom tags in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Drop-down menus with custom tags in JSP" Watch "Drop-down menus with custom tags in JSP" New topic

Drop-down menus with custom tags in JSP

Rupa S

Joined: Dec 08, 2004
Posts: 10
I have a JSP which has cutom tags for creating menubar and menus.Now i want to have submenus within menus onmouseover.I have to do this using custom tags, please help, give some sample code as i am new to custom tags.
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
read the documentation for your tags. If it's supported it should be mentioned somewhere how to do it.

Rupa S

Joined: Dec 08, 2004
Posts: 10
I searched a lot for a way to create a drop down menu in a JSP which has custom tags, but unable to find any help.Can anybody help out.
Nandkishore Dhilde

Joined: May 09, 2002
Posts: 20
Its very simple you just need to create
public class MenuBarTag extends BodyTagSupport {
// and in doStartTag or doEndTag u can call the getHtml() where u can write pure html code for creating menus...
public int doEndTag() throws JspException {
try {
this.getHtml() //write here html code
} catch(JSPException ) {}


SCJP1.4 certified, IBM SOA Solution Designer[2007]
Rupa S

Joined: Dec 08, 2004
Posts: 10
How can i write direct html from my tag handler class, the html will involve JavaScript funtions and that when given to the xsl embedded in my jsp page causes error.
I am terribly lost, please help.I am getting solutions with pure html pages calling javascript functions but mine is a JSP full of custom tags and the taghandlers write to the outputstream, which in turn is transformed by the XSLT and the actual HTML is rendered.Hence i cant use pure html in the JSP.

Please help with some sample code, i will be grateful.
Thankx in advance
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Drop-down menus with custom tags in JSP
Similar Threads
How to define multiple tag handlers
web-app advice
Simple XSL Transformation
Creating a dynamic menu
JSP Custom Tag Vs AJAX JSP tags