IT's Very Simple and Not Full. THE Simple Process IS:
1. Write class: The class usually inherit (extend) tagsupport (or some other). The functions Below Are Useful:
Public int doendtag ()
Throws JSPEXCEPTION
Public int desartTAG ()
Throws JSPEXCEPTION
The Example Is Below:
Public class demotag extends tagsupport {private string name = "oriname";
public int doStartTag () throws JspException {// HttpServletRequest request = (HttpServletRequest) pageContext.getRequest (); JspWriter out = pageContext.getOut (); try {out.println ( "Tags Entered .......... Out.println ("Name IS" Name "..............");} catch (ioException e) {E.PrintStackTrace ();} return skip_body; }
Public string getname () {return name;}
Public void setname (string name) {this.name = name;}}
2. Define TLD (Tag Library Define) File, Below Is One Example, The Header of The File Important:
XML Version = "1.0" encoding = "ISO-8859-1">
ON ABOVE, The
3. Use the tag in jsp:
3.1 DECLEAR TAGLIB, LIKE: <% @ Taglib Uri = "/ Web-INF / MyTaglib.tld" prefix = "mytag"%>
3.2 USE:
4. OK :)