{"id":27115,"date":"2021-05-11T23:10:04","date_gmt":"2021-05-12T03:10:04","guid":{"rendered":"http:\/\/bangla.salearningschool.com\/recent-posts\/headingtag-java-custom-tag-that-makes-use-of-a-tag-body-programming-code-examples-java-j2ee-j2me-applets-and-basic-graphics\/"},"modified":"2021-05-11T23:10:04","modified_gmt":"2021-05-12T03:10:04","slug":"headingtag-java-custom-tag-that-makes-use-of-a-tag-body-programming-code-examples-java-j2ee-j2me-applets-and-basic-graphics","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=27115","title":{"rendered":"HeadingTag.java Custom tag that makes use of a tag body #Programming Code Examples #Java\/J2EE\/J2ME #Applets and Basic Graphics"},"content":{"rendered":"<pre>\nHeadingTag.java Custom tag that makes use of a tag body\n\n\npackage cwp.tags;\n\nimport javax.servlet.jsp.*;\nimport javax.servlet.jsp.tagext.*;\nimport java.io.*;\n\n\/** Generates an HTML heading with the specified background\n *  color, foreground color, alignment, font, and font size.\n *  You can also turn on a border around it, which normally\n *  just barely encloses the heading, but which can also\n *  stretch wider. All attributes except the background\n *  color are optional.\n *  &lt;P&gt;\n *  Taken from Core Web Programming Java 2 Edition\n *  from Prentice Hall and Sun Microsystems Press,\n *  .\n *  May be freely used or adapted.\n *\/\n\npublic class HeadingTag extends TagSupport {\n  private String bgColor; \/\/ The one required attribute\n  private String color = null;\n  private String align=&quot;CENTER&quot;;\n  private String fontSize=&quot;36&quot;;\n  private String fontList=&quot;Arial, Helvetica, sans-serif&quot;;\n  private String border=&quot;0&quot;;\n  private String width=null;\n\n  public void setBgColor(String bgColor) {\n    this.bgColor = bgColor;\n  }\n\n  public void setColor(String color) {\n    this.color = color;\n  }\n\n  public void setAlign(String align) {\n    this.align = align;\n  }\n\n  public void setFontSize(String fontSize) {\n    this.fontSize = fontSize;\n  }\n\n  public void setFontList(String fontList) {\n    this.fontList = fontList;\n  }\n\n  public void setBorder(String border) {\n    this.border = border;\n  }\n\n  public void setWidth(String width) {\n    this.width = width;\n  }\n\n  public int doStartTag() {\n    try {\n      JspWriter out = pageContext.getOut();\n      out.print(&quot;&lt;TABLE BORDER=&quot; + border +\n                &quot; BGCOLOR=&quot;&quot; + bgColor + &quot;&quot;&quot; +\n                &quot; ALIGN=&quot;&quot; + align + &quot;&quot;&quot;);\n      if (width != null) {\n        out.print(&quot; WIDTH=&quot;&quot; + width + &quot;&quot;&quot;);\n      }\n      out.print(&quot;&gt;&lt;TR&gt;&lt;TH&gt;&quot;);\n      out.print(&quot;&lt;SPAN STYLE=&quot;&quot; +\n                &quot;font-size: &quot; + fontSize + &quot;px; &quot; +\n                &quot;font-family: &quot; + fontList + &quot;; &quot;);\n      if (color != null) {\n        out.println(&quot;color: &quot; + color + &quot;;&quot;);\n      }\n      out.print(&quot;&quot;&gt; &quot;); \/\/ End of &lt;SPAN ...&gt;\n    } catch(IOException ioe) {\n      System.out.println(&quot;Error in HeadingTag: &quot; + ioe);\n    }\n    return(EVAL_BODY_INCLUDE); \/\/ Include tag body\n  }\n\n  public int doEndTag() {\n    try {\n      JspWriter out = pageContext.getOut();\n      out.print(&quot;&lt;\/SPAN&gt;&lt;\/TABLE&gt;&quot;);\n    } catch(IOException ioe) {\n      System.out.println(&quot;Error in HeadingTag: &quot; + ioe);\n    }\n    return(EVAL_PAGE); \/\/ Continue with rest of JSP page\n  }\n}\n\n\n<\/pre>\n<p>Note: Brought from our old site: http:\/\/www.salearningschool.com\/example_codes\/ on Jan 2nd, 2017 From: http:\/\/sitestree.com\/?p=10279<br \/> Categories:Programming Code Examples, Java\/J2EE\/J2ME, Applets and Basic Graphics<br \/>Tags:Java\/J2EE\/J2MEApplets and Basic Graphics<br \/> Post Data:2017-01-02 16:04:31<\/p>\n<p>\t\tShop Online: <a href='https:\/\/www.ShopForSoul.com\/' target='new' rel=\"noopener\">https:\/\/www.ShopForSoul.com\/<\/a><br \/>\n\t\t(Big Data, Cloud, Security, Machine Learning): Courses: <a href='http:\/\/Training.SitesTree.com' target='new' rel=\"noopener\"> http:\/\/Training.SitesTree.com<\/a><br \/>\n\t\tIn Bengali: <a href='http:\/\/Bangla.SaLearningSchool.com' target='new' rel=\"noopener\">http:\/\/Bangla.SaLearningSchool.com<\/a><br \/>\n\t\t<a href='http:\/\/SitesTree.com' target='new' rel=\"noopener\">http:\/\/SitesTree.com<\/a><br \/>\n\t\t8112223 Canada Inc.\/JustEtc: <a href='http:\/\/JustEtc.net' target='new' rel=\"noopener\">http:\/\/JustEtc.net (Software\/Web\/Mobile\/Big-Data\/Machine Learning) <\/a><br \/>\n\t\tShop Online: <a href='https:\/\/www.ShopForSoul.com'> https:\/\/www.ShopForSoul.com\/<\/a><br \/>\n\t\tMedium: <a href='https:\/\/medium.com\/@SayedAhmedCanada' target='new' rel=\"noopener\"> https:\/\/medium.com\/@SayedAhmedCanada <\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>HeadingTag.java Custom tag that makes use of a tag body package cwp.tags; import javax.servlet.jsp.*; import javax.servlet.jsp.tagext.*; import java.io.*; \/** Generates an HTML heading with the specified background * color, foreground color, alignment, font, and font size. * You can also turn on a border around it, which normally * just barely encloses the heading, but &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=27115\">Continue reading<\/a><\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1917],"tags":[],"class_list":["post-27115","post","type-post","status-publish","format-standard","hentry","category-fromsitestree-com","item-wrap"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":10457,"url":"http:\/\/bangla.sitestree.com\/?p=10457","url_meta":{"origin":27115,"position":0},"title":"HeadingTag.java Custom tag that makes use of a tag body","author":"","date":"August 28, 2015","format":false,"excerpt":"HeadingTag.java Custom tag that makes use of a tag body package cwp.tags; import javax.servlet.jsp.*; import javax.servlet.jsp.tagext.*; import java.io.*; \/** Generates an HTML heading with the specified background \u00a0*\u00a0 color, foreground color, alignment, font, and font size. \u00a0*\u00a0 You can also turn on a border around it, which normally \u00a0*\u00a0 just\u2026","rel":"","context":"In &quot;Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8&quot;","block_context":{"text":"Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8","link":"http:\/\/bangla.sitestree.com\/?cat=1417"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":10460,"url":"http:\/\/bangla.sitestree.com\/?p=10460","url_meta":{"origin":27115,"position":1},"title":"HeadingExample.jsp Page that uses the HeadingTag custom tag","author":"","date":"August 28, 2015","format":false,"excerpt":"HeadingExample.jsp Page that uses the HeadingTag custom tag <!DOCTYPE HTML PUBLIC \"-\/\/W3C\/\/DTD HTML 4.0 Transitional\/\/EN\"> <!-- Illustration of HeadingTag tag. Taken from Core Web Programming Java 2 Edition from Prentice Hall and Sun Microsystems Press, . May be freely used or adapted. --> <HTML> <HEAD> <TITLE>Some Tag-Generated Headings<\/TITLE> <\/HEAD> <BODY>\u2026","rel":"","context":"In &quot;Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8&quot;","block_context":{"text":"Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8","link":"http:\/\/bangla.sitestree.com\/?cat=1417"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":27117,"url":"http:\/\/bangla.sitestree.com\/?p=27117","url_meta":{"origin":27115,"position":2},"title":"HeadingExample.jsp Page that uses the HeadingTag custom tag #Programming Code Examples #Java\/J2EE\/J2ME #Applets and Basic Graphics","author":"Author-Check- Article-or-Video","date":"May 11, 2021","format":false,"excerpt":"HeadingExample.jsp Page that uses the HeadingTag custom tag <!DOCTYPE HTML PUBLIC \"-\/\/W3C\/\/DTD HTML 4.0 Transitional\/\/EN\"> <!-- Illustration of HeadingTag tag. Taken from Core Web Programming Java 2 Edition from Prentice Hall and Sun Microsystems Press, . May be freely used or adapted. --> <HTML> <HEAD> <TITLE>Some Tag-Generated Headings<\/TITLE> <\/HEAD> <BODY>\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":10473,"url":"http:\/\/bangla.sitestree.com\/?p=10473","url_meta":{"origin":27115,"position":3},"title":"IfTag.java, IfConditionTag.java, IfThenTag.java, and IfElseTag.java, Custom tags that make use of tag nesting","author":"","date":"August 28, 2015","format":false,"excerpt":"IfTag.java, IfConditionTag.java, IfThenTag.java, and IfElseTag.java, Custom tags that make use of tag nesting IfTag.java package cwp.tags; import javax.servlet.jsp.*; import javax.servlet.jsp.tagext.*; import java.io.*; import javax.servlet.*; \/** A tag that acts like an if\/then\/else. \u00a0*\u00a0 <P> \u00a0*\u00a0 Taken from Core Web Programming Java 2 Edition \u00a0*\u00a0 from Prentice Hall and Sun Microsystems\u2026","rel":"","context":"In &quot;Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8&quot;","block_context":{"text":"Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8","link":"http:\/\/bangla.sitestree.com\/?cat=1417"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":27129,"url":"http:\/\/bangla.sitestree.com\/?p=27129","url_meta":{"origin":27115,"position":4},"title":"IfTag.java, IfConditionTag.java, IfThenTag.java, and IfElseTag.java, Custom tags that make use of tag nesting #Programming Code Examples #Java\/J2EE\/J2ME #Applets and Basic Graphics","author":"Author-Check- Article-or-Video","date":"May 11, 2021","format":false,"excerpt":"IfTag.java, IfConditionTag.java, IfThenTag.java, and IfElseTag.java, Custom tags that make use of tag nesting IfTag.java package cwp.tags; import javax.servlet.jsp.*; import javax.servlet.jsp.tagext.*; import java.io.*; import javax.servlet.*; \/** A tag that acts like an if\/then\/else. * <P> * Taken from Core Web Programming Java 2 Edition * from Prentice Hall and Sun Microsystems\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":10462,"url":"http:\/\/bangla.sitestree.com\/?p=10462","url_meta":{"origin":27115,"position":5},"title":"DebugTag.java Custom tag that optionally makes use of a tag body","author":"","date":"August 28, 2015","format":false,"excerpt":"DebugTag.java Custom tag that optionally makes use of a tag body package cwp.tags; import javax.servlet.jsp.*; import javax.servlet.jsp.tagext.*; import java.io.*; import javax.servlet.*; \/** A tag that includes the body content only if \u00a0*\u00a0 the \"debug\" request parameter is set. \u00a0*\u00a0 <P> \u00a0*\u00a0 Taken from Core Web Programming Java 2 Edition \u00a0*\u00a0\u2026","rel":"","context":"In &quot;Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8&quot;","block_context":{"text":"Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8","link":"http:\/\/bangla.sitestree.com\/?cat=1417"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/27115","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=27115"}],"version-history":[{"count":0,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/27115\/revisions"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=27115"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=27115"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=27115"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}