{"id":69282,"date":"2021-08-16T20:38:53","date_gmt":"2021-08-17T00:38:53","guid":{"rendered":"http:\/\/bangla.salearningschool.com\/recent-posts\/jsp-random-information-37\/"},"modified":"2021-08-16T20:38:53","modified_gmt":"2021-08-17T00:38:53","slug":"jsp-random-information-37","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=69282","title":{"rendered":"JSP: Random Information #37"},"content":{"rendered":"<ul>\n<li>Three JSP constructs: scripting elements, actions, directives<\/li>\n<li>Scripting elements: expressions, scriptlets, declarations<\/li>\n<li>Expression = translates to println in servlets in _jspService methods\n<pre> &lt; % = expression %&gt; &lt; % = new java.util.Date() %&gt;<\/pre>\n<p>inserts values directly to the output<\/li>\n<li>scriptlet: block of java code : directly inserted into the related servlets in the _jspService method:\n<pre>&lt; % java code %&gt;<\/pre>\n<\/li>\n<li>declarations:\n<pre>&lt; %! variable and method declarions%&gt;<\/pre>\n<p>Directly placed in the body of the translated servlets<\/li>\n<li>&gt;= JSP 1.2 : XML Syntax for expressions, scriptlets, declarations\n<pre>Java ExpressionJava CodeJSP Declaration<\/pre>\n<\/li>\n<li>JSP implicit objects: request, response, out, session<\/li>\n<li>Implicit objects: application = servletContext = persistent data, config = ServletConfig = initialization parameters, pageContext = context to store reference to objects, and page = this, exception = used by error pages :<\/li>\n<li>\n<pre>&lt; %@ directive attribute =\"value \" %&gt;&lt; %@ directive attribute1 =\"value1 \" attribute2 =\"value2 \" ... attributeN =\"valueN \" %&gt;<\/pre>\n<\/li>\n<li>JSP Directives : page, include, taglib<\/li>\n<li>page directive attributes: import, extends, session, isThreadSafe, buffer, autoFlush, contentType, pageEncoding, errorPage, isErrorPage, language, and info<\/li>\n<li>\n<pre>&lt; %@ page import=\"package.class \" %&gt;&lt; %@ page import=\"package.class1,...,package.classN \" %&gt;&lt; %@ page extends=\"somepackage.someclass \" %&gt;&lt; %@ page session=\"true\" %&gt;&lt; %@ page session=\"false\" %&gt;&lt; %@ page isThreadSafe=\"true\" %&gt;&lt; %@ page isThreadSafe=\"false\" %&gt; &lt; %@ page buffer=\"none\" %&gt;&lt; %@ page buffer=\"sizekb\" %&gt;&lt; %@ page autoFlush=\"true\" %&gt;&lt; %@ page autoFlush=\"false\" %&gt;&lt; %@ page contentType=\"MIME-Type \" %&gt;&lt; %@ page contentType=\"MIME-Type ; charset=Character-Set \" %&gt;&lt; %@ page contentType=\"video\/mpeg\" %&gt;&lt; %@ page pageEncoding=\"GB_2312-80\" %&gt;&lt; %@ page errorPage=\"Relative URL \" %&gt;&lt; %@ page info=\"Some Message \" %&gt;<\/pre>\n<\/li>\n<li>XML Syntax<\/li>\n<li>Other directives:<\/li>\n<li>\n<pre>&lt; %@ include file=\"relevantURLspec \" %&gt; : output of another file<\/pre>\n<\/li>\n<li>JSP Custom Tag:\n<pre> &lt; %@ taglib uri=\"TagLibraryURI \" prefix=\"someprefix \" %&gt;<\/pre>\n<\/li>\n<li>JSP Pages and Java Beans: JSP page can include logics in Java Code &#8211; not recommended &#8211; rather embed code into beans or custom tags<\/li>\n<li>JavaBean: basically a class, visible, also invisible: JSP supports both types:<\/li>\n<li>JavaBeans are accessed through Introspections :<\/li>\n<li>Introspection: a class that extends BeanInfo Interface<\/li>\n<li>JSP action tags for Java Beans: jsp:useBean, jsp:getProperty, jsp:setProperty<\/li>\n<li>jsp:useBean: attributes: id, class, scope=(page,request,session,application), beanName, type,<\/li>\n<li>jsp:getProperty: name = name of the bean = id of jsp:useBean, property = property to access<\/li>\n<li>jsp:setProperty: attributes: name = name of the bean = id of jsp:useBean, property = property to access, value = value to set, use param attribute to extract from request object for setting values<\/li>\n<li>To use a bean from JSP page, place the bean class file in one of the accessible servlet directories<\/li>\n<li>Custom Tags = alternatives to java beans for JSP = reduces some limitations of JavaBeans (in JSP) like to few methods to access the bean, you may still require to write much java code in JSP [that we want to avoid]<\/li>\n<\/ul>\n<p>From: http:\/\/sitestree.com\/?p=4963<br \/> Categories:37<br \/>Tags:<br \/> Post Data:2007-04-22 17:46:00<\/p>\n<pre><code>    Shop Online: &lt;a href='https:\/\/www.ShopForSoul.com\/' target='new' rel=\"noopener\"&gt;https:\/\/www.ShopForSoul.com\/&lt;\/a&gt;\n    (Big Data, Cloud, Security, Machine Learning): Courses: &lt;a href='http:\/\/Training.SitesTree.com' target='new' rel=\"noopener\"&gt; http:\/\/Training.SitesTree.com&lt;\/a&gt; \n    In Bengali: &lt;a href='http:\/\/Bangla.SaLearningSchool.com' target='new' rel=\"noopener\"&gt;http:\/\/Bangla.SaLearningSchool.com&lt;\/a&gt;\n    &lt;a href='http:\/\/SitesTree.com' target='new' rel=\"noopener\"&gt;http:\/\/SitesTree.com&lt;\/a&gt;\n    8112223 Canada Inc.\/JustEtc: &lt;a href='http:\/\/JustEtc.net' target='new' rel=\"noopener\"&gt;http:\/\/JustEtc.net (Software\/Web\/Mobile\/Big-Data\/Machine Learning) &lt;\/a&gt;\n    Shop Online: &lt;a href='https:\/\/www.ShopForSoul.com'&gt; https:\/\/www.ShopForSoul.com\/&lt;\/a&gt;\n    Medium: &lt;a href='https:\/\/medium.com\/@SayedAhmedCanada' target='new' rel=\"noopener\"&gt; https:\/\/medium.com\/@SayedAhmedCanada &lt;\/a&gt;\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Three JSP constructs: scripting elements, actions, directives Scripting elements: expressions, scriptlets, declarations Expression = translates to println in servlets in _jspService methods &lt; % = expression %&gt; &lt; % = new java.util.Date() %&gt; inserts values directly to the output scriptlet: block of java code : directly inserted into the related servlets in the _jspService method: &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=69282\">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-69282","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":10140,"url":"http:\/\/bangla.sitestree.com\/?p=10140","url_meta":{"origin":69282,"position":0},"title":"AccessCounts.jsp Page that demonstrates JSP declarations.","author":"","date":"August 7, 2015","format":false,"excerpt":"AccessCounts.jsp\u00a0 Page that demonstrates JSP declarations. <!DOCTYPE HTML PUBLIC \"-\/\/W3C\/\/DTD HTML 4.0 Transitional\/\/EN\"> <!--\u00a0 \u00a0 Taken from Core Web Programming Java 2 Edition from Prentice Hall and Sun Microsystems Press, . May be freely used or adapted. --> <HTML> <HEAD> <TITLE>JSP Declarations<\/TITLE> <META NAME=\"keywords\" \u00a0\u00a0\u00a0\u00a0\u00a0 CONTENT=\"JSP,declarations,JavaServer,Pages,servlets\"> <META NAME=\"description\" \u00a0\u00a0\u00a0\u00a0\u00a0 CONTENT=\"A\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":26812,"url":"http:\/\/bangla.sitestree.com\/?p=26812","url_meta":{"origin":69282,"position":1},"title":"AccessCounts.jsp  Page that demonstrates JSP declarations. #Programming Code Examples #Java\/J2EE\/J2ME #JSP","author":"Author-Check- Article-or-Video","date":"May 2, 2021","format":false,"excerpt":"AccessCounts.jsp Page that demonstrates JSP declarations. <!DOCTYPE HTML PUBLIC \"-\/\/W3C\/\/DTD HTML 4.0 Transitional\/\/EN\"> <!-- Taken from Core Web Programming Java 2 Edition from Prentice Hall and Sun Microsystems Press, . May be freely used or adapted. --> <HTML> <HEAD> <TITLE>JSP Declarations<\/TITLE> <META NAME=\"keywords\" CONTENT=\"JSP,declarations,JavaServer,Pages,servlets\"> <META NAME=\"description\" CONTENT=\"A quick example of\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":10132,"url":"http:\/\/bangla.sitestree.com\/?p=10132","url_meta":{"origin":69282,"position":2},"title":"Expressions.jsp Page that demonstrates JSP expressions. Uses the JSP-Styles style sheet.","author":"","date":"July 29, 2015","format":false,"excerpt":"Expressions.jsp\u00a0 Page that demonstrates JSP expressions. Uses the JSP-Styles\u00a0 style sheet. <!DOCTYPE HTML PUBLIC \"-\/\/W3C\/\/DTD HTML 4.0 Transitional\/\/EN\"> <!-- Example of JSP Expressions. \u00a0 \u00a0 Taken from Core Web Programming Java 2 Edition from Prentice Hall and Sun Microsystems Press, . May be freely used or adapted. --> <HTML> <HEAD>\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":10135,"url":"http:\/\/bangla.sitestree.com\/?p=10135","url_meta":{"origin":69282,"position":3},"title":"Expressions.jsp Page that demonstrates JSP expressions. Uses the JSP-Styles style sheet.","author":"","date":"August 9, 2015","format":false,"excerpt":"Expressions.jsp\u00a0 Page that demonstrates JSP expressions. Uses the JSP-Styles\u00a0 style sheet. <!DOCTYPE HTML PUBLIC \"-\/\/W3C\/\/DTD HTML 4.0 Transitional\/\/EN\"> <!-- Example of JSP Expressions. \u00a0 \u00a0 Taken from Core Web Programming Java 2 Edition from Prentice Hall and Sun Microsystems Press, . May be freely used or adapted. --> <HTML> <HEAD>\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":26793,"url":"http:\/\/bangla.sitestree.com\/?p=26793","url_meta":{"origin":69282,"position":4},"title":"Expressions.jsp  Page that demonstrates JSP expressions. Uses the JSP-Styles  style sheet. #Programming Code Examples #Java\/J2EE\/J2ME #JSP","author":"Author-Check- Article-or-Video","date":"May 1, 2021","format":false,"excerpt":"Expressions.jsp Page that demonstrates JSP expressions. Uses the JSP-Styles style sheet. <!DOCTYPE HTML PUBLIC \"-\/\/W3C\/\/DTD HTML 4.0 Transitional\/\/EN\"> <!-- Example of JSP Expressions. Taken from Core Web Programming Java 2 Edition from Prentice Hall and Sun Microsystems Press, . May be freely used or adapted. --> <HTML> <HEAD> <TITLE>JSP Expressions<\/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":26810,"url":"http:\/\/bangla.sitestree.com\/?p=26810","url_meta":{"origin":69282,"position":5},"title":"BGColor.jsp  Page that demonstrates JSP scriptlets. Uses the JSP-Styles  style sheet. #Programming Code Examples #Java\/J2EE\/J2ME #JSP","author":"Author-Check- Article-or-Video","date":"May 2, 2021","format":false,"excerpt":"BGColor.jsp Page that demonstrates JSP scriptlets. Uses the JSP-Styles style sheet. <!DOCTYPE HTML PUBLIC \"-\/\/W3C\/\/DTD HTML 4.0 Transitional\/\/EN\"> <!-- Taken from Core Web Programming Java 2 Edition from Prentice Hall and Sun Microsystems Press, . May be freely used or adapted. --> <HTML> <HEAD> <TITLE>Color Testing<\/TITLE> <\/HEAD> <% String bgColor\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\/69282","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=69282"}],"version-history":[{"count":0,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/69282\/revisions"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=69282"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=69282"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=69282"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}