JSP custom tag Tag El function

Source: Internet
Author: User

Original: JSP Custom label Tagel function

Source code: Http://www.zuidaima.com/share/1550463459052544.htm

Easy-to-understand custom El functions

Tag.java
</pre><p> </p><pre name= "code" class= "Java" >package Com.zuidaima.tag;import Java.io.ioexception;import Javax.servlet.jsp.jspexception;import Javax.servlet.jsp.jspwriter;import Javax.servlet.jsp.pagecontext;import javax.servlet.jsp.tagext.simpletagsupport;/*** @author Www.zuidaima.com**/public class Msgtag extends simpletagsupport{private String info;private int qty;public msgtag () {System.out.println ("Msgtag ' s constructor ...");} public void SetInfo (String info) {System.out.println ("SetInfo ..." + info); this.info = info;} public void Setqty (int qty) {System.out.println ("Setqty ..." + qty); this.qty = qty;} @Overridepublic void Dotag () throws Jspexception, IOException {System.out.println ("Dotag ...");// Through the Getjspcontext method provided by Simpletagsupport//Get PageContext. PageContext provides a way to obtain additional//several hidden objects. PageContext CTX = (PageContext) getjspcontext (); JspWriter out = Ctx.getout (), for (int i=0;i < qty;i++) {Out.println (info + "<br/>");}} 

JSP custom tag tag el function

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.