{"id":10464,"date":"2015-08-28T07:10:38","date_gmt":"2015-08-28T11:10:38","guid":{"rendered":"http:\/\/bangla.salearningschool.com\/?p=10464"},"modified":"2015-08-24T10:28:38","modified_gmt":"2015-08-24T14:28:38","slug":"debugexample-jsp-page-that-uses-the-debugtag-custom-tag","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=10464","title":{"rendered":"DebugExample.jsp Page that uses the DebugTag custom tag"},"content":{"rendered":"<pre># DebugExample.jsp Page that uses the DebugTag custom tag\r\n\r\n&lt;!DOCTYPE HTML PUBLIC \"-\/\/W3C\/\/DTD HTML 4.0 Transitional\/\/EN\"&gt;\r\n&lt;!-- \r\nIllustration of SimplePrimeTag tag. \r\n\r\nTaken from Core Web Programming Java 2 Edition\r\nfrom Prentice Hall and Sun Microsystems Press,\r\n.\r\nMay be freely used or adapted. \r\n--&gt;\r\n&lt;HTML&gt;\r\n&lt;HEAD&gt;\r\n&lt;TITLE&gt;Using the Debug Tag&lt;\/TITLE&gt;\r\n&lt;LINK REL=STYLESHEET\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 HREF=\"JSP-Styles.css\"\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 TYPE=\"text\/css\"&gt;\r\n&lt;\/HEAD&gt;\r\n&lt;BODY&gt;\r\n&lt;H1&gt;Using the Debug Tag&lt;\/H1&gt;\r\n&lt;%@ taglib uri=\"cwp-taglib.tld\" prefix=\"cwp\" %&gt;\r\nTop of regular page. Blah, blah, blah. Yadda, yadda, yadda.\r\n&lt;P&gt;\r\n&lt;cwp:debug&gt;\r\n&lt;B&gt;Debug:&lt;\/B&gt;\r\n&lt;UL&gt;\r\n\u00a0 &lt;LI&gt;Current time: &lt;%= new java.util.Date() %&gt;\r\n\u00a0 &lt;LI&gt;Requesting hostname: &lt;%= request.getRemoteHost() %&gt;\r\n\u00a0 &lt;LI&gt;Session ID: &lt;%= session.getId() %&gt;\r\n&lt;\/UL&gt;\r\n&lt;\/cwp:debug&gt;\r\n&lt;P&gt;\r\nBottom of regular page. Blah, blah, blah. Yadda, yadda, yadda.\r\n&lt;\/BODY&gt;\r\n&lt;\/HTML&gt;\r\n\r\npackage cwp.tags;\r\n\r\nimport javax.servlet.jsp.*;\r\nimport javax.servlet.jsp.tagext.*;\r\nimport java.io.*;\r\nimport javax.servlet.*;\r\n\r\n\/** A tag that includes the body content only if\r\n\u00a0*\u00a0 the \"debug\" request parameter is set.\r\n\u00a0*\u00a0 &lt;P&gt;\r\n\u00a0*\u00a0 Taken from Core Web Programming Java 2 Edition\r\n\u00a0*\u00a0 from Prentice Hall and Sun Microsystems Press,\r\n\u00a0*\u00a0 .\r\n\u00a0*\u00a0 May be freely used or adapted.\r\n\u00a0*\/\r\n\r\npublic class DebugTag extends TagSupport {\r\n\u00a0 public int doStartTag() {\r\n\u00a0\u00a0\u00a0 ServletRequest request = pageContext.getRequest();\r\n\u00a0\u00a0\u00a0 String debugFlag = request.getParameter(\"debug\");\r\n\u00a0\u00a0\u00a0 if ((debugFlag != null) &amp;&amp;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 (!debugFlag.equalsIgnoreCase(\"false\"))) {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 return(EVAL_BODY_INCLUDE);\r\n\u00a0\u00a0\u00a0 } else {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 return(SKIP_BODY);\r\n\u00a0\u00a0\u00a0 }\r\n\u00a0 }\r\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p># DebugExample.jsp Page that uses the DebugTag custom tag &lt;!DOCTYPE HTML PUBLIC &#8220;-\/\/W3C\/\/DTD HTML 4.0 Transitional\/\/EN&#8221;&gt; &lt;!&#8211; Illustration of SimplePrimeTag tag. Taken from Core Web Programming Java 2 Edition from Prentice Hall and Sun Microsystems Press, . May be freely used or adapted. &#8211;&gt; &lt;HTML&gt; &lt;HEAD&gt; &lt;TITLE&gt;Using the Debug Tag&lt;\/TITLE&gt; &lt;LINK REL=STYLESHEET \u00a0\u00a0\u00a0\u00a0\u00a0 HREF=&#8221;JSP-Styles.css&#8221; \u00a0\u00a0\u00a0\u00a0\u00a0 &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=10464\">Continue reading<\/a><\/p>\n","protected":false},"author":130,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1417,1424],"tags":[706,308,285],"class_list":["post-10464","post","type-post","status-publish","format-standard","hentry","category-code-programming-samples--","category-javaj2eej2me","tag-code","tag-java","tag-285","item-wrap"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":27121,"url":"http:\/\/bangla.sitestree.com\/?p=27121","url_meta":{"origin":10464,"position":0},"title":"# DebugExample.jsp Page that uses the DebugTag 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":"# DebugExample.jsp Page that uses the DebugTag custom tag <!DOCTYPE HTML PUBLIC \"-\/\/W3C\/\/DTD HTML 4.0 Transitional\/\/EN\"> <!-- Illustration of SimplePrimeTag 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>Using the Debug Tag<\/TITLE>\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":10451,"url":"http:\/\/bangla.sitestree.com\/?p=10451","url_meta":{"origin":10464,"position":1},"title":"SimplePrimeExample.jsp Page that uses the SimplePrimeTag custom tag","author":"","date":"August 28, 2015","format":false,"excerpt":"SimplePrimeExample.jsp Page that uses the SimplePrimeTag custom tag <!DOCTYPE HTML PUBLIC \"-\/\/W3C\/\/DTD HTML 4.0 Transitional\/\/EN\"> <!-- Illustration of SimplePrimeTag 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 50-Digit Primes<\/TITLE> <LINK REL=STYLESHEET\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":10168,"url":"http:\/\/bangla.sitestree.com\/?p=10168","url_meta":{"origin":10464,"position":2},"title":"EncodedPage.java Servlet that shows the bandwidth benefits of gzipping pages to browsers that can handle gzip. Uses the ServletUtilities class to simplify the DOCTYPE and HEAD output.","author":"","date":"August 18, 2015","format":false,"excerpt":"EncodedPage.java\u00a0 Servlet that shows the bandwidth benefits of gzipping pages to browsers that can handle gzip. Uses the ServletUtilities\u00a0 class to simplify the DOCTYPE and HEAD output. package cwp; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import java.util.zip.*; \/** Example showing benefits of gzipping pages to browsers \u00a0*\u00a0 that can handle\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":10455,"url":"http:\/\/bangla.sitestree.com\/?p=10455","url_meta":{"origin":10464,"position":3},"title":"PrimeExample.jsp Page that uses the PrimeTag custom tag","author":"","date":"August 28, 2015","format":false,"excerpt":"PrimeExample.jsp Page that uses the PrimeTag custom tag <!DOCTYPE HTML PUBLIC \"-\/\/W3C\/\/DTD HTML 4.0 Transitional\/\/EN\"> <!-- Illustration of PrimeTag 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 N-Digit Primes<\/TITLE> <LINK REL=STYLESHEET\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":27109,"url":"http:\/\/bangla.sitestree.com\/?p=27109","url_meta":{"origin":10464,"position":4},"title":"SimplePrimeExample.jsp Page that uses the SimplePrimeTag 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":"SimplePrimeExample.jsp Page that uses the SimplePrimeTag custom tag <!DOCTYPE HTML PUBLIC \"-\/\/W3C\/\/DTD HTML 4.0 Transitional\/\/EN\"> <!-- Illustration of SimplePrimeTag 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 50-Digit Primes<\/TITLE> <LINK REL=STYLESHEET\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":26533,"url":"http:\/\/bangla.sitestree.com\/?p=26533","url_meta":{"origin":10464,"position":5},"title":"EncodedPage.java  Servlet that shows the bandwidth benefits of gzipping pages to browsers that can handle gzip. Uses the ServletUtilities  class to simplify the DOCTYPE and HEAD output. #Programming Code Examples #Java\/J2EE\/J2ME #Servlet","author":"Author-Check- Article-or-Video","date":"April 27, 2021","format":false,"excerpt":"EncodedPage.java Servlet that shows the bandwidth benefits of gzipping pages to browsers that can handle gzip. Uses the ServletUtilities class to simplify the DOCTYPE and HEAD output. package cwp; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import java.util.zip.*; \/** Example showing benefits of gzipping pages to browsers * that can handle\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":[]}],"_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/10464","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\/130"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10464"}],"version-history":[{"count":2,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/10464\/revisions"}],"predecessor-version":[{"id":10466,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/10464\/revisions\/10466"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10464"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10464"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10464"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}