| |||||||||||||||||||
The simplest kind of tag does not evaluate it's contents.
Using a taglib in a JSP file has two steps. First, the JSP needs to define the and the (tag library descriptor) for the tag.Normally, JSP copies bytes from the .jsp to the browser without interpreting it. The directive tells the JSP engine to treat elements starting with the prefix as JSP extension tags.
Many simple tags can just extend . The hello tag implements . When the hello tag starts, the JSP will execute doStartTag. In this case, it'll print "hello, world".Since the content of the hello tag doesn't matter, HelloTag returns . Empty tags will generally return .
Finally, you need to configure the tag in a .tld (tag library descriptor) file. The .tld matches the tag name with the tag class .
|