• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Drop-down menus with custom tags in JSP

 
Rupa S
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
read the documentation for your tags. If it's supported it should be mentioned somewhere how to do it.
 
Rupa S
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ) {}
}

}
 
Rupa S
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic