{"id":45,"date":"2009-01-27T14:13:15","date_gmt":"2009-01-27T21:13:15","guid":{"rendered":"http:\/\/www.zulutown.com\/blog\/?p=45"},"modified":"2009-01-27T14:13:15","modified_gmt":"2009-01-27T21:13:15","slug":"java-ee-web-application-with-eclipse-ganymede","status":"publish","type":"post","link":"http:\/\/www.zulutown.com\/blog\/2009\/01\/27\/java-ee-web-application-with-eclipse-ganymede\/","title":{"rendered":"Java EE Web Application with Eclipse Ganymede"},"content":{"rendered":"<p>First of all setup Eclipse Ganymede for Java EE and add to it a Tomcat6 server, as described in my previous tutorial.<\/p>\n<p>Choose, from the <em>File<\/em> menu <em>New, Dynamic Web Project<\/em> in the option panel, give a name to the project (i.e. <em>Struts2-Rest<\/em>), choose a Target Runtime (that you should have already defined, in my case, Apache Tomcat v.6.0) and click Next.<\/p>\n<div id=\"attachment_46\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-46\" class=\"size-medium wp-image-46\" title=\"New Dynamic Web Project\" src=\"http:\/\/www.zulutown.com\/blog\/wp-content\/uploads\/2009\/01\/new-dynamic-web-project-300x288.png\" alt=\"New Dynamic Web Project\" width=\"300\" height=\"288\" srcset=\"http:\/\/www.zulutown.com\/blog\/wp-content\/uploads\/2009\/01\/new-dynamic-web-project-300x288.png 300w, http:\/\/www.zulutown.com\/blog\/wp-content\/uploads\/2009\/01\/new-dynamic-web-project.png 701w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><p id=\"caption-attachment-46\" class=\"wp-caption-text\">New Dynamic Web Project<\/p><\/div>\n<p>Here you can define the web application context root, that&#8217;s the relative path where it will be accessibile, if you choose <code>Struts2-Rest<\/code> as context root, your application will be accessible on <code>http:\/\/www.yourserver.com\/Struts2-Rest<\/code> or  <code>http:\/\/localhost:8080\/Struts2-Rest<\/code> if you use the default Tomcat configuration provided by Eclipse (with the Tomcat HTTP Connector on the port 8080)<\/p>\n<p>The <em>Content Directory<\/em> parameters defines the directory inside your project where is located the &#8220;root&#8221; of the .war you&#8217;re going to generate, use the default <code>WebContent<\/code> directory.<\/p>\n<p>And, obviously, <em>Java Source Directory<\/em> defines the directory where your Java sources will be stored. Just for your information, after compilation, the generated <code>.class<\/code> files are automatically moved by Eclipse into <code>WebContent\/WEB-INF\/classes<\/code>.<\/p>\n<div id=\"attachment_47\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-47\" class=\"size-medium wp-image-47\" title=\"New Dynamic Web Project - Web Module\" src=\"http:\/\/www.zulutown.com\/blog\/wp-content\/uploads\/2009\/01\/new-dynamic-web-project-web-module-300x288.png\" alt=\"New Dynamic Web Project - Web Module\" width=\"300\" height=\"288\" srcset=\"http:\/\/www.zulutown.com\/blog\/wp-content\/uploads\/2009\/01\/new-dynamic-web-project-web-module-300x288.png 300w, http:\/\/www.zulutown.com\/blog\/wp-content\/uploads\/2009\/01\/new-dynamic-web-project-web-module.png 701w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><p id=\"caption-attachment-47\" class=\"wp-caption-text\">New Dynamic Web Project - Web Module<\/p><\/div>\n<p>Just click finish. Your brand new project will appear in the <em>Project Explorer<\/em><\/p>\n<div id=\"attachment_48\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-48\" class=\"size-medium wp-image-48\" title=\"Project Explorer - New Web Project Created\" src=\"http:\/\/www.zulutown.com\/blog\/wp-content\/uploads\/2009\/01\/web-project-created-300x195.png\" alt=\"Project Explorer - New Web Project Created\" width=\"300\" height=\"195\" srcset=\"http:\/\/www.zulutown.com\/blog\/wp-content\/uploads\/2009\/01\/web-project-created-300x195.png 300w, http:\/\/www.zulutown.com\/blog\/wp-content\/uploads\/2009\/01\/web-project-created.png 390w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><p id=\"caption-attachment-48\" class=\"wp-caption-text\">Project Explorer - New Web Project Created<\/p><\/div>\n<p>The Deployment Descriptor is obviously associated with the <em>web.xml<\/em> file. The Java Resources (<code>src<\/code>) contains your source code, and <code>WebContent<\/code> contains all the  <code>.jsp<\/code> files, the static contents (images, css, javascripts) and the WEB-INF directory of your .war that will contain the compiled classes (in <code>\/WEB-INF\/classes<\/code>) and the libraries (in <code>\/WEB-INF\/lib<\/code>).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>First of all setup Eclipse Ganymede for Java EE and add to it a Tomcat6 server, as described in my previous tutorial. Choose, from the File menu New, Dynamic Web Project in the option panel, give a name to the &hellip; <a href=\"http:\/\/www.zulutown.com\/blog\/2009\/01\/27\/java-ee-web-application-with-eclipse-ganymede\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,11],"tags":[164,6,168,13,12],"_links":{"self":[{"href":"http:\/\/www.zulutown.com\/blog\/wp-json\/wp\/v2\/posts\/45"}],"collection":[{"href":"http:\/\/www.zulutown.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.zulutown.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.zulutown.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.zulutown.com\/blog\/wp-json\/wp\/v2\/comments?post=45"}],"version-history":[{"count":1,"href":"http:\/\/www.zulutown.com\/blog\/wp-json\/wp\/v2\/posts\/45\/revisions"}],"predecessor-version":[{"id":49,"href":"http:\/\/www.zulutown.com\/blog\/wp-json\/wp\/v2\/posts\/45\/revisions\/49"}],"wp:attachment":[{"href":"http:\/\/www.zulutown.com\/blog\/wp-json\/wp\/v2\/media?parent=45"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.zulutown.com\/blog\/wp-json\/wp\/v2\/categories?post=45"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.zulutown.com\/blog\/wp-json\/wp\/v2\/tags?post=45"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}