{"id":26154,"date":"2015-08-17T15:00:15","date_gmt":"2015-08-17T12:00:15","guid":{"rendered":"http:\/\/examples.javacodegeeks.com\/?p=26154"},"modified":"2019-04-10T13:07:19","modified_gmt":"2019-04-10T10:07:19","slug":"jetty-jsp-example","status":"publish","type":"post","link":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-jsp-example\/","title":{"rendered":"Jetty JSP Example"},"content":{"rendered":"<p><span style=\"font-weight: 400\">JSP (JavaServer Pages) which is core part of Java EE, enables developers to create dynamic web content based on the Java Servlet technology.<\/span> <span style=\"font-weight: 400\">In this example, we are going to enable Jetty for JSP. We will start with Embedded mode of Jetty. We are going to initialize our embedded Jetty to run JSP pages. Thereafter we will continue with standalone mode and shortly mention the JSP configuration in standalone mode.<\/span><\/p>\n<p>Jetty supports two JSP Engine implementations: Apache Jasper and Glassfish Jasper. Starting from Jetty version 9.2, the default and favored implementation is Apache Jasper. In this example we are going to use this one; however we will show how we can switch to Glassfish implementation in the standalone mode.<\/p>\n<p><span style=\"font-weight: 400\">At this point, we have to mention that, this example should not be considered as a JSP tutorial but a demonstration of JSP on Jetty container.<\/span>\n<\/p>\n<h2>1. Environment<\/h2>\n<p><span style=\"font-weight: 400\">In the example, following environment will be used:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Java 8 (Java 7 is also OK)<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Maven 3.x.y<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Eclipse Luna(as the IDE)<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Jetty v9.2.11 (In Embedded Jetty example, we will add Jetty libraries through Maven)<\/span><\/li>\n<\/ul>\n<h2>2. JSP with Embedded Jetty<\/h2>\n<h3>2.1 Structure of the Example<\/h3>\n<p><span style=\"font-weight: 400\">In this example, we are going enable JSP in an Embedded Jetty. We are going to implement a very simple JSP page which will demonstrate JSP and JSTL capabilities. We are going to package this application as a WAR file; so we will be able to drop and run it in a standalone Jetty.<\/span><\/p>\n<h3>2.2 Creating the Maven Project in Eclipse<\/h3>\n<p><span style=\"font-weight: 400\">We will create the Maven project in Eclipse, applying the steps below:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Go to File -&gt; New -&gt;Other -&gt; Maven Project<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Tick Create a simple project and press \u201cNext\u201d.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Enter groupId as : <\/span><span style=\"font-weight: 400\">com.javacodegeeks.snippets.enterprise<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Enter artifactId as : <\/span><span style=\"font-weight: 400\">jetty-jsp-example<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Select packaging as \u201cwar\u201d.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Press \u201cFinish\u201d.<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400\">After creating our project, we are going to add following dependencies to our <\/span><i><span style=\"font-weight: 400\">pom.xml<\/span><\/i><span style=\"font-weight: 400\">:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">org.eclipse.jetty:jetty-server<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">org.eclipse.jetty:jetty-webapp<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">org.eclipse.jetty:jetty-annotations<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">org.eclipse.jetty:apache-jsp<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">jstl:jstl<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400\">The first dependency <\/span><i><span style=\"font-weight: 400\">(jetty-server) <\/span><\/i><span style=\"font-weight: 400\">is the core Jetty dependency. <\/span><i><span style=\"font-weight: 400\">jetty-webapp <\/span><\/i><span style=\"font-weight: 400\">is needed for creating Jetty web application context. <\/span><i><span style=\"font-weight: 400\">jetty-annotations<\/span><\/i><span style=\"font-weight: 400\"> dependency can be viewed as a utility, which makes JSP initialization easier.<\/span><i><span style=\"font-weight: 400\"> apache-jsp<\/span><\/i><span style=\"font-weight: 400\"> dependency is the Apache implementation of JSP and finally <\/span><i><span style=\"font-weight: 400\">jstl<\/span><\/i><span style=\"font-weight: 400\"> is the JSP standard tag library(version 1.2).<\/span><\/p>\n<p><span style=\"font-weight: 400\">After adding the necessary dependencies, our pom.xml looks like:<\/span><\/p>\n<pre class=\"brush:xml\">&lt;dependencies&gt;\n\t\t&lt;!--Jetty dependencies start here --&gt;\n\t\t&lt;dependency&gt;\n\t\t\t&lt;groupId&gt;org.eclipse.jetty&lt;\/groupId&gt;\n\t\t\t&lt;artifactId&gt;jetty-server&lt;\/artifactId&gt;\n\t\t\t&lt;version&gt;9.2.11.v20150529&lt;\/version&gt;\n\t\t&lt;\/dependency&gt;\n\n\t\t&lt;dependency&gt;\n\t\t\t&lt;groupId&gt;org.eclipse.jetty&lt;\/groupId&gt;\n\t\t\t&lt;artifactId&gt;jetty-webapp&lt;\/artifactId&gt;\n\t\t\t&lt;version&gt;9.2.11.v20150529&lt;\/version&gt;\n\t\t\t\n\t\t&lt;\/dependency&gt;\n\t\t&lt;dependency&gt;\n\t\t\t&lt;groupId&gt;org.eclipse.jetty&lt;\/groupId&gt;\n\t\t\t&lt;artifactId&gt;jetty-annotations&lt;\/artifactId&gt;\n\t\t\t&lt;version&gt;9.2.11.v20150529&lt;\/version&gt;\n\t\t&lt;\/dependency&gt;\n\t\t&lt;!-- Jetty Dependencies end here --&gt;\n\n\t\t&lt;!--Jetty Apache JSP dependency  --&gt;\n\t\t&lt;dependency&gt;\n\t\t\t&lt;groupId&gt;org.eclipse.jetty&lt;\/groupId&gt;\n\t\t\t&lt;artifactId&gt;apache-jsp&lt;\/artifactId&gt;\n\t\t\t&lt;version&gt;9.2.11.v20150529&lt;\/version&gt;\n\t\t\t\n\t\t&lt;\/dependency&gt;\n\n\t\t&lt;!-- JSTL Dependency --&gt;\n\n\t\t&lt;dependency&gt;\n\t\t\t&lt;groupId&gt;jstl&lt;\/groupId&gt;\n\t\t\t&lt;artifactId&gt;jstl&lt;\/artifactId&gt;\n\t\t\t&lt;version&gt;1.2&lt;\/version&gt;\n\t\t&lt;\/dependency&gt;\n&lt;\/dependencies&gt;\n<\/pre>\n<h3>2.3 Configuring the Web Application<\/h3>\n<p><span style=\"font-weight: 400\">As mentioned above, we are going to configure a very simple JSP application which will demonstrate both JSP and JSTL capabilities. The steps needed are described below:<\/span><div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Create the folder <\/span><i><span style=\"font-weight: 400\">src\/main\/webapp<\/span><\/i><span style=\"font-weight: 400\"> under your project directory(if not exists).<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Create <\/span><i><span style=\"font-weight: 400\">WEB-INF<\/span><\/i><span style=\"font-weight: 400\"> directory under <\/span><i><span style=\"font-weight: 400\">src\/main\/webapp<\/span><\/i><span style=\"font-weight: 400\"> (if not exists). <\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Create<\/span><i><span style=\"font-weight: 400\"> web.xml <\/span><\/i><span style=\"font-weight: 400\">under <\/span><i><span style=\"font-weight: 400\">src\/main\/webapp\/WEB-INF<\/span><\/i><span style=\"font-weight: 400\">.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Create<\/span><i><span style=\"font-weight: 400\"> example.jsp <\/span><\/i><span style=\"font-weight: 400\">under <\/span><i><span style=\"font-weight: 400\">src\/main\/webapp<\/span><\/i><span style=\"font-weight: 400\">.<\/span><\/li>\n<\/ol>\n<p>The content of the web.xml to enable JSP can be viewed below:<\/p>\n<pre class=\"brush:xml\">&lt;web-app xmlns=\"http:\/\/java.sun.com\/xml\/ns\/javaee\" xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"\n\txsi:schemaLocation=\"http:\/\/java.sun.com\/xml\/ns\/javaee http:\/\/java.sun.com\/xml\/ns\/javaee\/web-app_2_5.xsd\"\n\tversion=\"2.5\"&gt;\n\t&lt;display-name&gt;JSP Example Application&lt;\/display-name&gt;\n\n\t&lt;servlet id=\"jsp\"&gt;\n\t\t&lt;servlet-name&gt;uu&lt;\/servlet-name&gt;\n\t\t&lt;servlet-class&gt;org.apache.jasper.servlet.JspServlet&lt;\/servlet-class&gt;\n\t\t&lt;init-param&gt;\n\t\t\t&lt;param-name&gt;logVerbosityLevel&lt;\/param-name&gt;\n\t\t\t&lt;param-value&gt;DEBUG&lt;\/param-value&gt;\n\t\t&lt;\/init-param&gt;\n\t\t&lt;init-param&gt;\n\t\t\t&lt;param-name&gt;fork&lt;\/param-name&gt;\n\t\t\t&lt;param-value&gt;&gt;false&lt;\/param-value&gt;\n\t\t&lt;\/init-param&gt;\n\t\t&lt;init-param&gt;\n\t\t\t&lt;param-name&gt;keepgenerated&lt;\/param-name&gt;\n\t\t\t&lt;param-value&gt;&gt;true&lt;\/param-value&gt;\n\t\t&lt;\/init-param&gt;\n\t\t&lt;load-on-startup&gt;0&lt;\/load-on-startup&gt;\n\t&lt;\/servlet&gt;\n\n\t&lt;servlet-mapping&gt;\n\t\t&lt;servlet-name&gt;jsp&lt;\/servlet-name&gt;\n\t\t&lt;url-pattern&gt;*.jsp&lt;\/url-pattern&gt;\n\t\t&lt;url-pattern&gt;*.jspf&lt;\/url-pattern&gt;\n\t\t&lt;url-pattern&gt;*.jspx&lt;\/url-pattern&gt;\n\t\t&lt;url-pattern&gt;*.xsp&lt;\/url-pattern&gt;\n\t\t&lt;url-pattern&gt;*.JSP&lt;\/url-pattern&gt;\n\t\t&lt;url-pattern&gt;*.JSPF&lt;\/url-pattern&gt;\n\t\t&lt;url-pattern&gt;*.JSPX&lt;\/url-pattern&gt;\n\t\t&lt;url-pattern&gt;*.XSP&lt;\/url-pattern&gt;\n\t&lt;\/servlet-mapping&gt;\n&lt;\/web-app&gt;\n<\/pre>\n<p><i><span style=\"font-weight: 400\">example.jsp<\/span><\/i><span style=\"font-weight: 400\"> is a simple JSP file which shows current date and outputs a literal text which is a JSTL expression. The content of the JSP file is as follows:<\/span><\/p>\n<p><span style=\"text-decoration: underline\"><em>example.jsp<\/em><\/span><\/p>\n<pre class=\"brush:xml\">&lt;%@page import=\"java.util.ArrayList\"%&gt;\n\n&lt;html&gt;\n&lt;head&gt;\n&lt;title&gt;Java Code Geeks Snippets - Sample JSP Page&lt;\/title&gt;\n&lt;meta&gt;\n&lt;%@ taglib uri=\"http:\/\/java.sun.com\/jsp\/jstl\/core\" prefix=\"c\"%&gt;\n&lt;\/meta&gt;\n&lt;\/head&gt;\n\n&lt;body&gt;\n\t&lt;c:out value=\"Jetty JSP Example\"&gt;&lt;\/c:out&gt;\n\t&lt;br \/&gt; \n\tCurrent date is: &lt;%=new java.util.Date()%&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;\n<\/pre>\n<h3>2.4 Enabling JSP programmatically<\/h3>\n<p><span style=\"font-weight: 400\">In this part, we are going to start an embedded Jetty server with the simple web application that we have configured in the previous section and thereafter we will enable JSP for our server. In order to keep things simple, we are going to implement our Jetty Server through our Main class of the project. You can see the <\/span><i><span style=\"font-weight: 400\">JettyJspExampleMain<\/span><\/i><span style=\"font-weight: 400\"> class below, decorated with source code comments.<\/span>[ulp id=&#8217;xFHGZUmgemwCMrAR&#8217;]<\/p>\n<p><span style=\"text-decoration: underline\"><em>JettyJspExampleMain.java<\/em><\/span><\/p>\n<pre class=\"brush:java\">package com.javacodegeeks.snippets.enterprise.jettyjsp;\n\nimport org.eclipse.jetty.server.Server;\nimport org.eclipse.jetty.webapp.WebAppContext;\n\npublic class JettyJspExampleMain {\n\n\tpublic static void main(String[] args) throws Exception {\n\n\t\t\/\/ 1. Creating the server on port 8080\n\t\tServer server = new Server(8080);\n\n\t\t\/\/ 2. Creating the WebAppContext for the created content\n\t\tWebAppContext ctx = new WebAppContext();\n\t\tctx.setResourceBase(\"src\/main\/webapp\");\n\t\tctx.setContextPath(\"\/jetty-jsp-example\");\n\t\t\n\t\t\/\/3. Including the JSTL jars for the webapp.\n\t\tctx.setAttribute(\"org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern\",\".*\/[^\/]*jstl.*\\\\.jar$\");\n\t\n\t\t\/\/4. Enabling the Annotation based configuration\n\t\torg.eclipse.jetty.webapp.Configuration.ClassList classlist = org.eclipse.jetty.webapp.Configuration.ClassList.setServerDefault(server);\n        classlist.addAfter(\"org.eclipse.jetty.webapp.FragmentConfiguration\", \"org.eclipse.jetty.plus.webapp.EnvConfiguration\", \"org.eclipse.jetty.plus.webapp.PlusConfiguration\");\n        classlist.addBefore(\"org.eclipse.jetty.webapp.JettyWebXmlConfiguration\", \"org.eclipse.jetty.annotations.AnnotationConfiguration\");\n        \n        \/\/5. Setting the handler and starting the Server\n\t\tserver.setHandler(ctx);\n\t\tserver.start();\n\t\tserver.join();\n\n\t}\n}\n\n<\/pre>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">First we initialize an embedded Server on port 8080.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Then we initialize the web application context.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">In Step 3, we include jstl jar for our web application. If we skip this step, we will not be able to use JSTL tags in our JSP pages.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">In step 4, we enable annotation based configuration for our server. This part of the code looks a bit like magical snippet, which seems irrelevant with JSP configuration; however these three lines is the most crucial part for JSP configuration. When annotation configuration is enabled, JSP implementation is automatically discovered and injected to the server. Otherwise we would have to implement it manually.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Step 5 includes the snippets for setting the context handler and starting the server.<\/span><\/li>\n<\/ol>\n<h3>2.5 Running the Application<\/h3>\n<p><span style=\"font-weight: 400\">When we run the application, our embedded server will start on port 8080. If we try to access <\/span><a href=\"http:\/\/localhost:8080\/jetty-jsp-example\/example.jsp\"><i><span style=\"font-weight: 400\">http:\/\/localhost:8080\/jetty-jsp-example\/example.jsp<\/span><\/i><\/a> <span style=\"font-weight: 400\">we can see our simple JSP page:<\/span><\/p>\n<p><figure id=\"attachment_26166\" aria-describedby=\"caption-attachment-26166\" style=\"width: 780px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/08\/jsp1.jpg\"><img decoding=\"async\" class=\"size-full wp-image-26166\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/08\/jsp1.jpg\" alt=\"Output of example.jsp\" width=\"780\" height=\"281\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/08\/jsp1.jpg 780w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/08\/jsp1-300x108.jpg 300w\" sizes=\"(max-width: 780px) 100vw, 780px\" \/><\/a><figcaption id=\"caption-attachment-26166\" class=\"wp-caption-text\">Output of <em>example.jsp<\/em><\/figcaption><\/figure><\/p>\n<p><span style=\"font-weight: 400\">In our webpage JSP, \u201cJetty JSP Example\u201d text comes from a JSTL expression whereas current date is an outcome of a core JSP expression.<\/span><\/p>\n<h2>3. JSP in Standalone Jetty<\/h2>\n<p><span style=\"font-weight: 400\">In the previous sections, we have discussed how to enable JSP on an Embedded Jetty. In the standalone mode, it is very easy to run JSP. In standalone mode, JSP is enabled by default. All we have to do is, dropping the JSP web application WAR in the <em>webapps<\/em> directory of Jetty. <\/span><\/p>\n<p><span style=\"font-weight: 400\">Jetty has a <\/span><i><span style=\"font-weight: 400\">jsp<\/span><\/i><span style=\"font-weight: 400\"> module which is enabled by default. You can disable it via the <\/span><i><span style=\"font-weight: 400\">start.ini<\/span><\/i><span style=\"font-weight: 400\"> file under <\/span><i><span style=\"font-weight: 400\">JETTY_HOME<\/span><\/i><span style=\"font-weight: 400\"> removing the following line:<\/span><\/p>\n<pre><span style=\"font-weight: 400\">--module=jsp\n<\/span><\/pre>\n<p><i><span style=\"font-weight: 400\">start.ini<\/span><\/i><span style=\"font-weight: 400\"> file has a line that sets <\/span><i><span style=\"font-weight: 400\">Apache<\/span><\/i><span style=\"font-weight: 400\"> as the default JSP &nbsp;implementation:<\/span><\/p>\n<pre><span style=\"font-weight: 400\">jsp-impl=apache<\/span><\/pre>\n<p><span style=\"font-weight: 400\">If we want to use <em>Glassfish<\/em> implementation for some reason, then we have to alter this line to:<\/span><\/p>\n<pre><span style=\"font-weight: 400\">jsp-impl=glassfish<\/span><\/pre>\n<h2>4. Conclusion<\/h2>\n<p><span style=\"font-weight: 400\">In this example, we have discussed how we can configure Jetty for JSP. We have first demonstrated configuration for Embedded Jetty with a simple JSP application, thereafter we have briefly mentioned how JSP is configured for the standalone mode.<\/span><\/p>\n<div class=\"download\"><strong>Download<\/strong><br \/>\nYou can download the full source code of this example here: <strong><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/08\/jetty-jsp-example.zip\">jetty-jsp-example<\/a><\/strong><\/div>\n","protected":false},"excerpt":{"rendered":"<p>JSP (JavaServer Pages) which is core part of Java EE, enables developers to create dynamic web content based on the Java Servlet technology. In this example, we are going to enable Jetty for JSP. We will start with Embedded mode of Jetty. We are going to initialize our embedded Jetty to run JSP pages. Thereafter &hellip;<\/p>\n","protected":false},"author":54,"featured_media":1239,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[1014,1030,1031],"class_list":["post-26154","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-jetty","tag-embedded","tag-jsp","tag-jstl"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Jetty JSP Example - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"JSP (JavaServer Pages) which is core part of Java EE, enables developers to create dynamic web content based on the Java Servlet technology. In this\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-jsp-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Jetty JSP Example - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"JSP (JavaServer Pages) which is core part of Java EE, enables developers to create dynamic web content based on the Java Servlet technology. In this\" \/>\n<meta property=\"og:url\" content=\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-jsp-example\/\" \/>\n<meta property=\"og:site_name\" content=\"Examples Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2015-08-17T12:00:15+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-04-10T10:07:19+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/codehaus-jetty-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Ibrahim Tasyurt\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@itasyurt\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ibrahim Tasyurt\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-jsp-example\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-jsp-example\/\"},\"author\":{\"name\":\"Ibrahim Tasyurt\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/b2b2c4a3762c4d2e0072b831fb6900f5\"},\"headline\":\"Jetty JSP Example\",\"datePublished\":\"2015-08-17T12:00:15+00:00\",\"dateModified\":\"2019-04-10T10:07:19+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-jsp-example\/\"},\"wordCount\":934,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-jsp-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/codehaus-jetty-logo.jpg\",\"keywords\":[\"embedded\",\"jsp\",\"jstl\"],\"articleSection\":[\"jetty\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-jsp-example\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-jsp-example\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-jsp-example\/\",\"name\":\"Jetty JSP Example - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-jsp-example\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-jsp-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/codehaus-jetty-logo.jpg\",\"datePublished\":\"2015-08-17T12:00:15+00:00\",\"dateModified\":\"2019-04-10T10:07:19+00:00\",\"description\":\"JSP (JavaServer Pages) which is core part of Java EE, enables developers to create dynamic web content based on the Java Servlet technology. In this\",\"breadcrumb\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-jsp-example\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-jsp-example\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-jsp-example\/#primaryimage\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/codehaus-jetty-logo.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/codehaus-jetty-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-jsp-example\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/examples.javacodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java Development\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/java-development\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/java-development\/enterprise-java\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"jetty\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/java-development\/enterprise-java\/jetty\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Jetty JSP Example\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Examples and Code Snippets\",\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/javacodegeeks\",\"https:\/\/x.com\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/b2b2c4a3762c4d2e0072b831fb6900f5\",\"name\":\"Ibrahim Tasyurt\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/06\/Ibrahim-Tasyurt-96x96.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/06\/Ibrahim-Tasyurt-96x96.jpg\",\"caption\":\"Ibrahim Tasyurt\"},\"description\":\"Ibrahim is a Senior Software Engineer residing in Ankara,Turkey. He holds BSc and MS degrees in Computer Engineering from Middle East Technical University(METU). Throughout his professional carrier, he has worked in Enterprise Web Application projects for public sector and telecommunications domains. Java EE, Web Services and Enterprise Application Integration are the areas he is primarily involved with.\",\"sameAs\":[\"http:\/\/www.javacodegeeks.com\/\",\"https:\/\/x.com\/itasyurt\"],\"url\":\"https:\/\/examples.javacodegeeks.com\/author\/ibrahim-tasyurt\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Jetty JSP Example - Java Code Geeks","description":"JSP (JavaServer Pages) which is core part of Java EE, enables developers to create dynamic web content based on the Java Servlet technology. In this","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:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-jsp-example\/","og_locale":"en_US","og_type":"article","og_title":"Jetty JSP Example - Java Code Geeks","og_description":"JSP (JavaServer Pages) which is core part of Java EE, enables developers to create dynamic web content based on the Java Servlet technology. In this","og_url":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-jsp-example\/","og_site_name":"Examples Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2015-08-17T12:00:15+00:00","article_modified_time":"2019-04-10T10:07:19+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/codehaus-jetty-logo.jpg","type":"image\/jpeg"}],"author":"Ibrahim Tasyurt","twitter_card":"summary_large_image","twitter_creator":"@itasyurt","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Ibrahim Tasyurt","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-jsp-example\/#article","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-jsp-example\/"},"author":{"name":"Ibrahim Tasyurt","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/b2b2c4a3762c4d2e0072b831fb6900f5"},"headline":"Jetty JSP Example","datePublished":"2015-08-17T12:00:15+00:00","dateModified":"2019-04-10T10:07:19+00:00","mainEntityOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-jsp-example\/"},"wordCount":934,"commentCount":1,"publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-jsp-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/codehaus-jetty-logo.jpg","keywords":["embedded","jsp","jstl"],"articleSection":["jetty"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-jsp-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-jsp-example\/","url":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-jsp-example\/","name":"Jetty JSP Example - Java Code Geeks","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-jsp-example\/#primaryimage"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-jsp-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/codehaus-jetty-logo.jpg","datePublished":"2015-08-17T12:00:15+00:00","dateModified":"2019-04-10T10:07:19+00:00","description":"JSP (JavaServer Pages) which is core part of Java EE, enables developers to create dynamic web content based on the Java Servlet technology. In this","breadcrumb":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-jsp-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-jsp-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-jsp-example\/#primaryimage","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/codehaus-jetty-logo.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/codehaus-jetty-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-jsp-example\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/examples.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java Development","item":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/enterprise-java\/"},{"@type":"ListItem","position":4,"name":"jetty","item":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/enterprise-java\/jetty\/"},{"@type":"ListItem","position":5,"name":"Jetty JSP Example"}]},{"@type":"WebSite","@id":"https:\/\/examples.javacodegeeks.com\/#website","url":"https:\/\/examples.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Examples and Code Snippets","publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/examples.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/examples.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/b2b2c4a3762c4d2e0072b831fb6900f5","name":"Ibrahim Tasyurt","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/06\/Ibrahim-Tasyurt-96x96.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/06\/Ibrahim-Tasyurt-96x96.jpg","caption":"Ibrahim Tasyurt"},"description":"Ibrahim is a Senior Software Engineer residing in Ankara,Turkey. He holds BSc and MS degrees in Computer Engineering from Middle East Technical University(METU). Throughout his professional carrier, he has worked in Enterprise Web Application projects for public sector and telecommunications domains. Java EE, Web Services and Enterprise Application Integration are the areas he is primarily involved with.","sameAs":["http:\/\/www.javacodegeeks.com\/","https:\/\/x.com\/itasyurt"],"url":"https:\/\/examples.javacodegeeks.com\/author\/ibrahim-tasyurt\/"}]}},"_links":{"self":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/26154","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/users\/54"}],"replies":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=26154"}],"version-history":[{"count":0,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/26154\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media\/1239"}],"wp:attachment":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=26154"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=26154"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=26154"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}