{"id":36649,"date":"2016-05-04T15:00:12","date_gmt":"2016-05-04T12:00:12","guid":{"rendered":"http:\/\/examples.javacodegeeks.com\/?p=36649"},"modified":"2019-04-10T13:03:39","modified_gmt":"2019-04-10T10:03:39","slug":"jetty-deploy-war-example","status":"publish","type":"post","link":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-deploy-war-example\/","title":{"rendered":"Jetty Deploy War Example"},"content":{"rendered":"<p>In this example, we will see how to deploy a war file on a jetty and run the web application. In general, jetty server instance configures the deploy module. This will have web application deployer that hot deploys files. But other way to deploy a war file is through deployable descriptor XML file.<\/p>\n<h2>1. Environment<\/h2>\n<ul>\n<li>Windows 7 SP 1<\/li>\n<li>Eclipse Kepler 4.3<\/li>\n<li>Jetty version 9.2.15.v20160210<\/li>\n<li>Java version 7<\/li>\n<li>Java servlet library &#8211; servlet-api-3.1<\/li>\n<li>Maven 3.0.4<\/li>\n<\/ul>\n<h2>2. Example Outline<\/h2>\n<p>In this example, we will create a sample example project and export that as a WAR file to deploy on <code> jetty <\/code>. And then we will configure the same project with <code> deployable descriptor xml <\/code> file with additional configuration parameters like context path.<\/p>\n<h2>3. Jetty Deploy War Example<\/h2>\n<p>Here we will create an eclipse project with a servlet and deploy that on jetty. We will deploy the same project with context path in second part of our example.<\/p>\n<h3>3.1 Create an Eclipse Project<\/h3>\n<p>Create a new Dynamic Web Project in eclipse. Go to File -&gt; New Project -&gt; Web -&gt; Dynamic Web Project.<\/p>\n<p><figure id=\"attachment_36809\" aria-describedby=\"caption-attachment-36809\" style=\"width: 793px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/JettyWarExample.jpg\"><img decoding=\"async\" class=\"size-full wp-image-36809\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/JettyWarExample.jpg\" alt=\"Jetty War Deploy Example\" width=\"793\" height=\"644\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/JettyWarExample.jpg 793w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/JettyWarExample-300x244.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/JettyWarExample-768x624.jpg 768w\" sizes=\"(max-width: 793px) 100vw, 793px\" \/><\/a><figcaption id=\"caption-attachment-36809\" class=\"wp-caption-text\">Jetty War Deploy Example<\/figcaption><\/figure><\/p>\n<p>After creating the project, we will add a servlet-api jar file so we can write our servlet.<\/p>\n<ol>\n<ol>\n<li>Go to Src folder in project directory and right click to select New Servlet<\/li>\n<li>Enter Package name <code> com.javacodegeeks.example <\/code><\/li>\n<li>Enter Servlet Name &#8211; WarServlet<\/li>\n<li>Keep default options and click Finish<\/li>\n<li>We will add some code in our <code> WarServlet <\/code> in <code> doGet <\/code> method.<\/li>\n<\/ol>\n<\/ol>\n<p><span style=\"text-decoration: underline;\"><em>WarServlet.java<\/em><\/span><\/p>\n<pre class=\"brush:java\"> \npackage com.javacodegeeks.example;\n\nimport java.io.IOException;\nimport javax.servlet.ServletException;\nimport javax.servlet.annotation.WebServlet;\nimport javax.servlet.http.HttpServlet;\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\/**\n * Servlet implementation class WarServlet\n *\/\n@WebServlet(description = \"Jetty War Deploy Example\", urlPatterns = { \"\/WarServlet\" })\npublic class WarServlet extends HttpServlet {\n\tprivate static final long serialVersionUID = 1L;\n\n    \/**\n     * Default constructor. \n     *\/\n    public WarServlet() {\n        \n    }\n\n\t\/**\n\t * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)\n\t *\/\n\tprotected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\t\n\t\tresponse.setContentType(\"text\/html\");\n\t\tresponse.getWriter().println(\" Jetty War Deploy Example with a simple Servlet \");\n\t}\n\n\t\/**\n\t * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)\n\t *\/\n\tprotected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\t\n\t}\n\n}\n\n\n<\/pre>\n<ol>\n<ol>\n<ol>\n<li>Export the project from eclipse as war file JettyWarExample<\/li>\n<li>Copy this <code> WAR <\/code> file in <code> jetty.base\/webapps <\/code> directory.<\/li>\n<\/ol>\n<\/ol>\n<\/ol>\n<p><figure id=\"attachment_36891\" aria-describedby=\"caption-attachment-36891\" style=\"width: 850px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/ExportWarFile-1.jpg\"><img decoding=\"async\" class=\"size-full wp-image-36891\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/ExportWarFile-1.jpg\" alt=\"Export War File\" width=\"850\" height=\"611\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/ExportWarFile-1.jpg 850w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/ExportWarFile-1-300x216.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/ExportWarFile-1-768x552.jpg 768w\" sizes=\"(max-width: 850px) 100vw, 850px\" \/><\/a><figcaption id=\"caption-attachment-36891\" class=\"wp-caption-text\">Export War File<\/figcaption><\/figure><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<ol>\n<li>If Jetty is running, it will pick up the WAR file dynamically<\/li>\n<li>Go to web browser and run <code> http:\/\/localhost:8080\/JettyWarExample\/WarServlet <\/code>, we will see the result as below<\/li>\n<\/ol>\n<\/ol>\n<p><figure id=\"attachment_36811\" aria-describedby=\"caption-attachment-36811\" style=\"width: 728px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/SimpleWarDeployment.jpg\"><img decoding=\"async\" class=\"size-full wp-image-36811\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/SimpleWarDeployment.jpg\" alt=\"Simple War Deployment\" width=\"728\" height=\"368\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/SimpleWarDeployment.jpg 728w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/SimpleWarDeployment-300x152.jpg 300w\" sizes=\"(max-width: 728px) 100vw, 728px\" \/><\/a><figcaption id=\"caption-attachment-36811\" class=\"wp-caption-text\">Simple War Deployment<\/figcaption><\/figure><\/p>\n<h3>3.2 Create A Jetty Deployable Descriptor XML file<\/h3>\n<p>The deployment descriptor xml file configures a <code> WebAppContext <\/code> class. For initial setting, we will set two properties <code> war <\/code> and <code> contextPath <\/code>. Jetty supports deploying Web Applications via XML files which will build an instance of a <code> ContextHandler <\/code> that Jetty can then deploy.[ulp id=&#8217;xFHGZUmgemwCMrAR&#8217;]<\/p>\n<p><span style=\"text-decoration: underline;\"><em>JettyWarExample.xml<\/em><\/span><\/p>\n<pre class=\"brush:xml\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\n&lt;!DOCTYPE Configure PUBLIC \"-\/\/Jetty\/\/Configure\/\/EN\" \n\n\"http:\/\/www.eclipse.org\/jetty\/configure_9_0.dtd\"&gt;\n \n&lt;Configure class=\"org.eclipse.jetty.webapp.WebAppContext\"&gt;\n  &lt;Set name=\"contextPath\"&gt;\/JettyWar&lt;\/Set&gt;\n  &lt;Set name=\"war\"&gt;&lt;Property name=\"jetty.webapps\" default=\".\"\/&gt;\/JettyWarExample.war&lt;\/Set&gt;\n&lt;\/Configure&gt;\n<\/pre>\n<p>Copy this file in <code> jetty.base\/webapps <\/code> directory and now restart jetty. Jetty scans its <code> $JETTY_HOME\/webapps <\/code> directory at startup for web applications to deploy. Go to Browser and access <code> http:\/\/localhost:8080\/JettyWar\/WarServlet <\/code>. You will see our the result as shown below<\/p>\n<p><figure id=\"attachment_36816\" aria-describedby=\"caption-attachment-36816\" style=\"width: 602px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/DeployableDescriptorExample.jpg\"><img decoding=\"async\" class=\"size-full wp-image-36816\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/DeployableDescriptorExample.jpg\" alt=\"Deployable Descriptor Example\" width=\"602\" height=\"288\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/DeployableDescriptorExample.jpg 602w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/DeployableDescriptorExample-300x144.jpg 300w\" sizes=\"(max-width: 602px) 100vw, 602px\" \/><\/a><figcaption id=\"caption-attachment-36816\" class=\"wp-caption-text\">Deployable Descriptor Example<\/figcaption><\/figure><\/p>\n<p>There are lot of other properties that can be configured using Deployment Descriptor. One such example is to configure database connection pool. Example of such a file is shown below:<\/p>\n<p><span style=\"text-decoration: underline;\"><em>JettyWarExample.xml<\/em><\/span><\/p>\n<pre class=\"brush:xml\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\n&lt;!DOCTYPE Configure PUBLIC \"-\/\/Jetty\/\/Configure\/\/EN\" \"http:\/\/www.eclipse.org\/jetty\/configure_9_0.dtd\"&gt;\n \n&lt;Configure class=\"org.eclipse.jetty.webapp.WebAppContext\"&gt;\n  &lt;Set name=\"contextPath\"&gt; \/JettyWar &lt;\/Set&gt;\n  &lt;Set name=\"war\"&gt;&lt;SystemProperty name=\"jetty.webapps\"\/&gt; \/JettyWarExample.war &lt;\/Set&gt;\n \n  &lt;New id=\"DSTest\" class=\"org.eclipse.jetty.plus.jndi.Resource\"&gt;\n    &lt;Arg&gt; jdbc\/DSTest &lt;\/Arg&gt;\n    &lt;Arg&gt;\n      &lt;New class=\"org.apache.commons.dbcp.BasicDataSource\"&gt;\n        &lt;Set name=\"driverClassName\"&gt;org.some.Driver&lt;\/Set&gt;\n        &lt;Set name=\"url\"&gt;jdbc.url&lt;\/Set&gt;\n        &lt;Set name=\"username\"&gt;jdbc.user&lt;\/Set&gt;\n        &lt;Set name=\"password\"&gt;jdbc.pass&lt;\/Set&gt;\n      &lt;\/New&gt;\n    &lt;\/Arg&gt;\n  &lt;\/New&gt;\n&lt;\/Configure&gt;\n\n<\/pre>\n<h2>4. Conclusion<\/h2>\n<p>In this example we showed how to use automatic way to deploy a war file on jetty server dynamically and by using a deployable descriptor xml file.<\/p>\n<h2>5. Download the example<\/h2>\n<p>This was an example for Jetty WAR Deployment with standalone jetty.<\/p>\n<div class=\"download\"><strong> Download <\/strong><br \/>\nYou can download the full source code of this example here:&nbsp;<strong><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/JettyWarExample.zip\">JettyWarExample<\/a><\/strong><\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this example, we will see how to deploy a war file on a jetty and run the web application. In general, jetty server instance configures the deploy module. This will have web application deployer that hot deploys files. But other way to deploy a war file is through deployable descriptor XML file. 1. Environment &hellip;<\/p>\n","protected":false},"author":91,"featured_media":1239,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[1315],"class_list":["post-36649","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-jetty","tag-war"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Jetty Deploy War Example - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"In this example, we will see how to deploy a war file on a jetty and run the web application. In general, jetty server instance configures the deploy\" \/>\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-deploy-war-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Jetty Deploy War Example - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"In this example, we will see how to deploy a war file on a jetty and run the web application. In general, jetty server instance configures the deploy\" \/>\n<meta property=\"og:url\" content=\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-deploy-war-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=\"2016-05-04T12:00:12+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-04-10T10:03:39+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=\"Yogesh Mali\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@yogeshmali\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Yogesh Mali\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 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-deploy-war-example\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-deploy-war-example\/\"},\"author\":{\"name\":\"Yogesh Mali\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/2baca97f7fa994c7c6a0449b07f9ef7b\"},\"headline\":\"Jetty Deploy War Example\",\"datePublished\":\"2016-05-04T12:00:12+00:00\",\"dateModified\":\"2019-04-10T10:03:39+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-deploy-war-example\/\"},\"wordCount\":480,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-deploy-war-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/codehaus-jetty-logo.jpg\",\"keywords\":[\"war\"],\"articleSection\":[\"jetty\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-deploy-war-example\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-deploy-war-example\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-deploy-war-example\/\",\"name\":\"Jetty Deploy War Example - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-deploy-war-example\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-deploy-war-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/codehaus-jetty-logo.jpg\",\"datePublished\":\"2016-05-04T12:00:12+00:00\",\"dateModified\":\"2019-04-10T10:03:39+00:00\",\"description\":\"In this example, we will see how to deploy a war file on a jetty and run the web application. In general, jetty server instance configures the deploy\",\"breadcrumb\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-deploy-war-example\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-deploy-war-example\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-deploy-war-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-deploy-war-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 Deploy War 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\/2baca97f7fa994c7c6a0449b07f9ef7b\",\"name\":\"Yogesh Mali\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/03\/Yogesh-Mali_avatar_1457206862-96x96.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/03\/Yogesh-Mali_avatar_1457206862-96x96.jpg\",\"caption\":\"Yogesh Mali\"},\"description\":\"Yogesh currently lives in Minneapolis and works as a Senior Software Engineer. He has a masters degree in Computer Science from University of Minnesota, Twin Cities. At graduate school, he did research in programming languages because of his love for functional and object oriented programming. Currently he delves into more details of Java, web development and security. Previously he worked as a product manager to create web application for health insurance brokers. In his free time, he listens to music and writes fictional stories.\",\"sameAs\":[\"http:\/\/www.javacodegeeks.com\/\",\"https:\/\/www.instagram.com\/yogsma\/\",\"https:\/\/www.linkedin.com\/in\/yogeshmali\",\"https:\/\/x.com\/yogeshmali\"],\"url\":\"https:\/\/examples.javacodegeeks.com\/author\/yogesh-mali\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Jetty Deploy War Example - Java Code Geeks","description":"In this example, we will see how to deploy a war file on a jetty and run the web application. In general, jetty server instance configures the deploy","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-deploy-war-example\/","og_locale":"en_US","og_type":"article","og_title":"Jetty Deploy War Example - Java Code Geeks","og_description":"In this example, we will see how to deploy a war file on a jetty and run the web application. In general, jetty server instance configures the deploy","og_url":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-deploy-war-example\/","og_site_name":"Examples Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2016-05-04T12:00:12+00:00","article_modified_time":"2019-04-10T10:03:39+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":"Yogesh Mali","twitter_card":"summary_large_image","twitter_creator":"@yogeshmali","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Yogesh Mali","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-deploy-war-example\/#article","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-deploy-war-example\/"},"author":{"name":"Yogesh Mali","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/2baca97f7fa994c7c6a0449b07f9ef7b"},"headline":"Jetty Deploy War Example","datePublished":"2016-05-04T12:00:12+00:00","dateModified":"2019-04-10T10:03:39+00:00","mainEntityOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-deploy-war-example\/"},"wordCount":480,"commentCount":0,"publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-deploy-war-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/codehaus-jetty-logo.jpg","keywords":["war"],"articleSection":["jetty"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-deploy-war-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-deploy-war-example\/","url":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-deploy-war-example\/","name":"Jetty Deploy War Example - Java Code Geeks","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-deploy-war-example\/#primaryimage"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-deploy-war-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/codehaus-jetty-logo.jpg","datePublished":"2016-05-04T12:00:12+00:00","dateModified":"2019-04-10T10:03:39+00:00","description":"In this example, we will see how to deploy a war file on a jetty and run the web application. In general, jetty server instance configures the deploy","breadcrumb":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-deploy-war-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-deploy-war-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jetty\/jetty-deploy-war-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-deploy-war-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 Deploy War 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\/2baca97f7fa994c7c6a0449b07f9ef7b","name":"Yogesh Mali","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/03\/Yogesh-Mali_avatar_1457206862-96x96.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/03\/Yogesh-Mali_avatar_1457206862-96x96.jpg","caption":"Yogesh Mali"},"description":"Yogesh currently lives in Minneapolis and works as a Senior Software Engineer. He has a masters degree in Computer Science from University of Minnesota, Twin Cities. At graduate school, he did research in programming languages because of his love for functional and object oriented programming. Currently he delves into more details of Java, web development and security. Previously he worked as a product manager to create web application for health insurance brokers. In his free time, he listens to music and writes fictional stories.","sameAs":["http:\/\/www.javacodegeeks.com\/","https:\/\/www.instagram.com\/yogsma\/","https:\/\/www.linkedin.com\/in\/yogeshmali","https:\/\/x.com\/yogeshmali"],"url":"https:\/\/examples.javacodegeeks.com\/author\/yogesh-mali\/"}]}},"_links":{"self":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/36649","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\/91"}],"replies":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=36649"}],"version-history":[{"count":0,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/36649\/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=36649"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=36649"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=36649"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}