

{"id":81367,"date":"2020-08-31T09:00:13","date_gmt":"2020-08-31T03:30:13","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=81367"},"modified":"2021-08-25T13:47:40","modified_gmt":"2021-08-25T08:17:40","slug":"jsp-syntax-and-semantics","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/jsp-syntax-and-semantics\/","title":{"rendered":"JSP Syntax and Semantics"},"content":{"rendered":"<p>This JSP Tutorial deals with the writing structure and the use of it by the JSP containers. It describes the main elements of a JSP page, namely scripting elements, directives, and actions. It also discusses additional elements like comments, implicit objects, custom tags. So let&#8217;s start with JSP Syntax and Semantics.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/08\/JSP-Syntax-Semantics.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-81382\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/08\/JSP-Syntax-Semantics.jpg\" alt=\"JSP Syntax and Semantics\" width=\"1200\" height=\"628\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/08\/JSP-Syntax-Semantics.jpg 1200w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/08\/JSP-Syntax-Semantics-300x157.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/08\/JSP-Syntax-Semantics-1024x536.jpg 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/08\/JSP-Syntax-Semantics-150x79.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/08\/JSP-Syntax-Semantics-768x402.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/08\/JSP-Syntax-Semantics-520x272.jpg 520w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><\/p>\n<h2>JSP Syntax and Semantics<\/h2>\n<p>As JSP deals with the writing of codes, a proper way to write that code becomes important. Thus we need to understand the syntax and semantics of a JSP code. To understand it better, we first need to know what syntax and semantics itself mean.<\/p>\n<p><strong>Syntax &#8211;<\/strong> Syntax is the coding structure to represent elements.<\/p>\n<p><strong>Semantics &#8211;<\/strong> It is the meaning of that element to the container i.e., what happens when that element is used.<br \/>\nThus we will discuss various elements that form the basis of JSP Syntax and Semantics<\/p>\n<h2>Components of a JSP Page<\/h2>\n<p>1) JSP elements<br \/>\n2) Fixed template data<br \/>\n3) Or a combination of both<\/p>\n<table>\n<tbody>\n<tr>\n<td><b>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0JSP elements<\/b><\/p>\n<p><span style=\"font-weight: 400\">JSP containers will recognize these instructions. They tell about the generation of the code and how it needs to be operated. They have specific start and end tags for their recognition and identification by the web container.<\/span><\/td>\n<td><b>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0Fixed template data<\/b><\/p>\n<p><span style=\"font-weight: 400\">As this data is static or fixed, the compiler will not recognize it. This data won\u2019t change so that when the HTML file\u00a0 generates at the end, this data remains intact.<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>JSP Elements<\/h2>\n<p>There are 3 most important elements in JSP<\/p>\n<p><strong>1. JSP scripting elements<\/strong><br \/>\n1.1 Expressions<br \/>\n1.2 Scriptlets<br \/>\n1.3 Declarations<\/p>\n<p><strong>2. Directives<\/strong><br \/>\n2.1page<br \/>\n2.2include<br \/>\n2.3taglib<\/p>\n<p><strong>3. Actions<\/strong><\/p>\n<p>Above mentioned elements form the most part of JSP code. In addition to this, various other elements are there like:<\/p>\n<ul>\n<li>Implicit objects<\/li>\n<li>JSP comments<\/li>\n<li>JSP custom tags<\/li>\n<\/ul>\n<h3>1. JSP Scripting Elements<\/h3>\n<h4>1.1 Expressions<\/h4>\n<p>They are a simple means for accessing the value of a Java variable. They can be an access point to other expressions and merging that value with HTML as well.<\/p>\n<p><strong>Syntax of expressions is:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;%=expression\/statement%&gt;\r\n<\/pre>\n<p>This code gets written to the output stream of the response. Now, this expression or statement can be any valid Java statement. This code will convert to out.print() statement when an auto generated servlet forms until and unless the expression is convertible to string format.<\/p>\n<p><strong>For Example:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;html&gt;\r\n&lt;head&gt;&lt;title&gt;Expression&lt;\/title&gt;\r\n \r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;h6&gt;--DataFlair--&lt;\/h6&gt;\r\n \r\n&lt;% String s1=\"kajal\"; %&gt;\r\n&lt;% out.print(s1); %&gt;\r\n&lt;% String s2=s1.toUpperCase(); %&gt;\r\n&lt;% out.println( \"  \"+s2); %&gt;\r\n \r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p><strong>Explanation:<\/strong> Each line in the code is an expression. In this code we convert lower case to upper case.<\/p>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/08\/syn1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-81384\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/08\/syn1.png\" alt=\"jsp expressions\" width=\"1366\" height=\"201\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/08\/syn1.png 1366w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/08\/syn1-300x44.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/08\/syn1-1024x151.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/08\/syn1-150x22.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/08\/syn1-768x113.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/08\/syn1-520x77.png 520w\" sizes=\"auto, (max-width: 1366px) 100vw, 1366px\" \/><\/a><\/p>\n<h4>1.2 Scriptlets<\/h4>\n<p>Scriptlets embed Java code in HTML for JSP code. It is like an expression, the only difference is that these are a set of statements written in Java language. It allows writing java code in it and is written between &lt;%&#8212;-%&gt; are called scriptlet tags. <strong>Syntax of Scriptlet tag is as follows:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;% statement; [statement;\u2026.]%&gt;\r\n<\/pre>\n<p>Everything that is inside a scriptlet goes to the _jspService() of the servlet code for processing the request. In case a code has multiple scriptlets then they will append in the _jspService in an ordered fashion.<\/p>\n<p><strong>For Example:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;html&gt;\r\n&lt;head&gt;&lt;title&gt;Scriptlet&lt;\/title&gt;\r\n \r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;h6&gt;--DataFlair--&lt;\/h6&gt;\r\n \r\n&lt;% int a=1;\r\n       int b=2;\r\n       int c=3;\r\n            out.println(\"The number is \" + a*b*c);\r\n%&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p><strong>Explanation:<\/strong> In this code, we multiply three numbers and print the result in scriptlet tags.<\/p>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/08\/syn4.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-81388\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/08\/syn4.png\" alt=\"jsp scriptlets\" width=\"1366\" height=\"204\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/08\/syn4.png 1366w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/08\/syn4-300x45.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/08\/syn4-1024x153.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/08\/syn4-150x22.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/08\/syn4-768x115.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/08\/syn4-520x78.png 520w\" sizes=\"auto, (max-width: 1366px) 100vw, 1366px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h4>1.3 Declarations<\/h4>\n<p>Declarations too have java language statements. Yet there lies a major difference. This code doesn\u2019t go to _jspService(). This code incorporates into the source file that gets generated outside the _jspService method. <strong>Syntax is:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;%! statement,[statement,\u2026.] %&gt;\r\n<\/pre>\n<p>Important points to note about declaration are that:<\/p>\n<ul>\n<li>They have no access to implicit objects(discussed further).<\/li>\n<li>They declare class\/instance\/variable\/methods\/inner classes.<\/li>\n<li>Declaration is inside the servlet class but remains outside the service method. As said earlier this code doesn\u2019t go to _jspService() method.<\/li>\n<li>If a method that is inside declaration wants to use requested object from scriptlet then it needs to pass the object as parameter.<\/li>\n<\/ul>\n<p><strong>Example of declaration in JSP:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;html&gt;\r\n&lt;head&gt;&lt;title&gt;Declaration&lt;\/title&gt;\r\n \r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;h6&gt;--DataFlair--&lt;\/h6&gt;\r\n&lt;%! int num=1, n=0; %&gt;\r\n&lt;% n=num+1;\r\n        out.println(\"The number is \" + n);\r\n%&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p><strong>Explanation:<\/strong> In this code, we have used declaration at code line 6, where we have declared the variables.<\/p>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/08\/syn3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-81387\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/08\/syn3.png\" alt=\"jsp scriptlets\" width=\"1366\" height=\"185\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/08\/syn3.png 1366w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/08\/syn3-300x41.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/08\/syn3-1024x139.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/08\/syn3-150x20.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/08\/syn3-768x104.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/08\/syn3-520x70.png 520w\" sizes=\"auto, (max-width: 1366px) 100vw, 1366px\" \/><\/a><\/p>\n<h3>2. Directives<\/h3>\n<p>It is a type of instruction to the web container at the time of translation. Directives tell what code needs to be generated. It affects the compilation of the JSP page done by the container. <strong>Syntax:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;%@ directive name [attribute=\u201dvalue\u201dattribute=\u201dvalue\u201d\u2026..]%&gt;\r\n<\/pre>\n<p><em><strong>Note:<\/strong><\/em> They &lt;%@&#8230;&#8230;%&gt; should lie in the same physical file.<\/p>\n<p><strong>Classification of Directives under 3 categories is as follows:<\/strong><\/p>\n<h4>2.1 Page Directive<\/h4>\n<p>It defines the attributes for the JSP page as a whole.<br \/>\n<strong>Syntax:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;%@ page[attribute=\u201dvalue\u201dattribute=\u201dvalue\u201d]%&gt;\r\n<\/pre>\n<p>The attributes of the page directive are:<\/p>\n<ul>\n<li>language<\/li>\n<li>extends<\/li>\n<li>import<\/li>\n<li>session<\/li>\n<li>buffer<\/li>\n<li>autoflush<\/li>\n<li>isThreadsafe<\/li>\n<li>info<\/li>\n<li>isErrorpage<\/li>\n<li>errorpage<\/li>\n<li>contentType<\/li>\n<\/ul>\n<p><strong>For Example:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;%@ page language=\u201djava\u201d contentType=\u201dtext\/.html\u201d&gt;\r\n<\/pre>\n<p><strong>Explanation:<\/strong><br \/>\nThis code implies that coding of the page has been done in Java where the contentType of output is text or an HTML response. We won\u2019t get an output here as directives are an offset to the JSP code only.<\/p>\n<h4>2.2 Include Directive<\/h4>\n<p>It works similarly to the #include of the C preprocessor directory. It\u2019s work is to merge the contents of another file into .jsp input stream at the translation phase. <strong>Syntax:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;%@ include file=\u201dfilename\u201d%&gt;\r\n<\/pre>\n<p><strong>For Example:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;%@ include file=\u201dheader.html\u201d&gt;\r\n&lt;%@ include file=\u201dsortmethod\u201d&gt;\r\n<\/pre>\n<p><strong>Explanation:<\/strong> The \u201cfilename\u201d can be the absolute name or the relative path name as shown in the example. There is no body coding here, only the use of include tag is shown so output is not there.<\/p>\n<h4>2.3 Taglib Directive<\/h4>\n<p>With the use of tag library this directive makes the custom tags available in the current page. <strong>Syntax can be shown as:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;%@ taglib uri=\u201dtaglib URI\u201dprefix=\u201dtagPrefix\u201d%&gt;\r\n<\/pre>\n<p>The attributes of this directive are:<\/p>\n<ul>\n<li>tagLibrary URI<\/li>\n<li>tagPrefix<\/li>\n<\/ul>\n<p>**The JSP directives section contains a detailed description of this topic.<\/p>\n<h3>3. Actions<\/h3>\n<p>Actions also known as standard actions unlike others are written in XML. These are also known as high level JSP elements. They create, modify or use other objects. <strong>Syntax:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;tagname attr=\u201dvalue\u201d:\u2026.&gt;\u2026.body\u2026\u2026.&lt;\/tagname&gt;\r\n<\/pre>\n<p>Proper nesting is important here. For e.g. &lt;A&gt;&lt;B&gt;\u2026\u2026\u2026.&lt;\/B&gt;&lt;\/A&gt; is right whereas &lt;A&gt;&lt;B&gt;\u2026\u2026\u2026&lt;\/A&gt;&lt;\/B&gt; is wrong.<br \/>\nImportant tags in actions are namely:<\/p>\n<ul>\n<li>&lt;jsp:usebean&gt;<\/li>\n<li>&lt;jsp:setProperty&gt;<\/li>\n<li>&lt;jsp:getProperty&gt;<\/li>\n<li>&lt;jsp:include&gt;<\/li>\n<li>&lt;jsp:forward&gt;<\/li>\n<li>&lt;jsp:param&gt;<\/li>\n<li>&lt;jsp:plugin&gt;<\/li>\n<\/ul>\n<p>**The article JSP Actions contains a detailed description of this topic.<br \/>\nHaving discussed the three essential elements of the JSP page, let&#8217;s discuss the periphery elements of a JSP page.<\/p>\n<h2>JSP Comments<\/h2>\n<p>Comments contain statements and texts but are ignored. They simply describe the code so that the usability and understanding increases.<br \/>\nThere are two types of comments in a JSP page. They are:<br \/>\nFirstly, JSPcomments that are written in the JSP code. JSP container ignores these comments. <strong>Syntax:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;%----Hidden JSP comment----%&gt;\r\n<\/pre>\n<p>Secondly the HTML comments that are written in the XML or HTML code. Browser ignores these comments. <strong>Syntax:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;!----included in generated HTML----!&gt;\r\n<\/pre>\n<p><strong>Example:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;html&gt;\r\n&lt;head&gt;&lt;title&gt;Comments&lt;\/title&gt;\r\n&lt;!---This is an HTML comment---&gt;\r\n&lt;h6&gt;--DataFlair--&lt;\/h6&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n \r\n&lt;%---This is a JSP comment---%&gt;\r\n&lt;% int a=1;\r\n   \tint b=2;\r\n  \tout.println(\"The addition of a and b is:\" + a+b);\r\n%&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p><strong>Explanation:<\/strong> In the generated output you can compare, the code and result. JSP and HTML comments get ignored by the JSP container and browser respectively.<\/p>\n<p><strong>Output:<\/strong><\/p>\n<h3><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/08\/syn2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-81386\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/08\/syn2.png\" alt=\"jsp scriptlets\" width=\"1366\" height=\"728\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/08\/syn2.png 1366w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/08\/syn2-300x160.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/08\/syn2-1024x546.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/08\/syn2-150x80.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/08\/syn2-768x409.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/08\/syn2-520x277.png 520w\" sizes=\"auto, (max-width: 1366px) 100vw, 1366px\" \/><\/a><\/h3>\n<p>Implicit Objects<\/p>\n<p>As we know that only scriptlet, expression and HTML data goes to _jspService() and these variables are implicitly available to all except declaration. Thus they are implicitly available; they don\u2019t need to be declared.<br \/>\nVarious implicit variables are request, response, pageContext, session, application, out, config, page, exception. They can also be created using tag libraries.<\/p>\n<h3>Custom Tags<\/h3>\n<p>These tags can be created so that the functionality of JSP can be extended. They allow the encapsulation of functionality. This is thus made available to non-expert page authors. There is a separate article to discuss custom tags in detail.<\/p>\n<h2>Conclusion<\/h2>\n<p>This article discusses the basic syntax and semantics in JSP. We have learned about different elements of a JSP code. They are scripting elements, directives, and actions. Scripting elements consist of the main coding part under the scriptlet tag. It also consists of declarations and expressions. We discussed another important part i.e., directives that tells about the attributes of the page, includes files necessary and gives advantages of custom tags. Other important parts discussed were comments, implicit objects, tag extensions.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This JSP Tutorial deals with the writing structure and the use of it by the JSP containers. It describes the main elements of a JSP page, namely scripting elements, directives, and actions. It also&#46;&#46;&#46;<\/p>\n","protected":false},"author":10,"featured_media":81382,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22403],"tags":[23083,23082,23081],"class_list":["post-81367","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-jsp","tag-jsp-semantics","tag-jsp-syntax","tag-jsp-syntax-and-semantics"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>JSP Syntax and Semantics - DataFlair<\/title>\n<meta name=\"description\" content=\"Learn about syntax &amp; semantics in JSP. Check different elements like scripting elements, directives, actions, comments, implicit objectsand tag extensions.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/jsp-syntax-and-semantics\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JSP Syntax and Semantics - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Learn about syntax &amp; semantics in JSP. Check different elements like scripting elements, directives, actions, comments, implicit objectsand tag extensions.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/jsp-syntax-and-semantics\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-08-31T03:30:13+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-08-25T08:17:40+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/08\/JSP-Syntax-Semantics.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"JSP Syntax and Semantics - DataFlair","description":"Learn about syntax & semantics in JSP. Check different elements like scripting elements, directives, actions, comments, implicit objectsand tag extensions.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/jsp-syntax-and-semantics\/","og_locale":"en_US","og_type":"article","og_title":"JSP Syntax and Semantics - DataFlair","og_description":"Learn about syntax & semantics in JSP. Check different elements like scripting elements, directives, actions, comments, implicit objectsand tag extensions.","og_url":"https:\/\/data-flair.training\/blogs\/jsp-syntax-and-semantics\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2020-08-31T03:30:13+00:00","article_modified_time":"2021-08-25T08:17:40+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/08\/JSP-Syntax-Semantics.jpg","type":"image\/jpeg"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/jsp-syntax-and-semantics\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/jsp-syntax-and-semantics\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/a90b082e16aa38d207212d22b0581f33"},"headline":"JSP Syntax and Semantics","datePublished":"2020-08-31T03:30:13+00:00","dateModified":"2021-08-25T08:17:40+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/jsp-syntax-and-semantics\/"},"wordCount":1290,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/jsp-syntax-and-semantics\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/08\/JSP-Syntax-Semantics.jpg","keywords":["jsp semantics","jsp syntax","JSP Syntax and Semantics"],"articleSection":["JSP Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/jsp-syntax-and-semantics\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/jsp-syntax-and-semantics\/","url":"https:\/\/data-flair.training\/blogs\/jsp-syntax-and-semantics\/","name":"JSP Syntax and Semantics - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/jsp-syntax-and-semantics\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/jsp-syntax-and-semantics\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/08\/JSP-Syntax-Semantics.jpg","datePublished":"2020-08-31T03:30:13+00:00","dateModified":"2021-08-25T08:17:40+00:00","description":"Learn about syntax & semantics in JSP. Check different elements like scripting elements, directives, actions, comments, implicit objectsand tag extensions.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/jsp-syntax-and-semantics\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/jsp-syntax-and-semantics\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/jsp-syntax-and-semantics\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/08\/JSP-Syntax-Semantics.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/08\/JSP-Syntax-Semantics.jpg","width":1200,"height":628,"caption":"JSP Syntax and Semantics"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/jsp-syntax-and-semantics\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"JSP Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/jsp\/"},{"@type":"ListItem","position":3,"name":"JSP Syntax and Semantics"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/a90b082e16aa38d207212d22b0581f33","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/dd6de0d647a0185cd6faf264e4ba860b0d85d08d7070766f9cd41bea5bb0b227?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/dd6de0d647a0185cd6faf264e4ba860b0d85d08d7070766f9cd41bea5bb0b227?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/dd6de0d647a0185cd6faf264e4ba860b0d85d08d7070766f9cd41bea5bb0b227?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"The DataFlair Team is passionate about delivering top-notch tutorials and resources on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. With expertise in the tech industry, we simplify complex topics to help learners excel. Stay updated with our latest insights.","url":"https:\/\/data-flair.training\/blogs\/author\/dfadteam1\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/81367","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=81367"}],"version-history":[{"count":4,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/81367\/revisions"}],"predecessor-version":[{"id":81389,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/81367\/revisions\/81389"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/81382"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=81367"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=81367"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=81367"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}