Warning: Trying to access array offset on value of type bool in /home/feltexco/public_html/felix/wp-content/plugins/google-maps-ready/modules/options/models/options.php on line 16

Warning: Trying to access array offset on value of type bool in /home/feltexco/public_html/felix/wp-content/plugins/google-maps-ready/modules/options/models/options.php on line 16

Warning: Trying to access array offset on value of type bool in /home/feltexco/public_html/felix/wp-content/plugins/google-maps-ready/modules/options/models/options.php on line 16

Warning: Cannot modify header information - headers already sent by (output started at /home/feltexco/public_html/felix/wp-content/plugins/google-maps-ready/modules/options/models/options.php:16) in /home/feltexco/public_html/felix/wp-includes/rest-api/class-wp-rest-server.php on line 1758

Warning: Cannot modify header information - headers already sent by (output started at /home/feltexco/public_html/felix/wp-content/plugins/google-maps-ready/modules/options/models/options.php:16) in /home/feltexco/public_html/felix/wp-includes/rest-api/class-wp-rest-server.php on line 1758

Warning: Cannot modify header information - headers already sent by (output started at /home/feltexco/public_html/felix/wp-content/plugins/google-maps-ready/modules/options/models/options.php:16) in /home/feltexco/public_html/felix/wp-includes/rest-api/class-wp-rest-server.php on line 1758

Warning: Cannot modify header information - headers already sent by (output started at /home/feltexco/public_html/felix/wp-content/plugins/google-maps-ready/modules/options/models/options.php:16) in /home/feltexco/public_html/felix/wp-includes/rest-api/class-wp-rest-server.php on line 1758

Warning: Cannot modify header information - headers already sent by (output started at /home/feltexco/public_html/felix/wp-content/plugins/google-maps-ready/modules/options/models/options.php:16) in /home/feltexco/public_html/felix/wp-includes/rest-api/class-wp-rest-server.php on line 1758

Warning: Cannot modify header information - headers already sent by (output started at /home/feltexco/public_html/felix/wp-content/plugins/google-maps-ready/modules/options/models/options.php:16) in /home/feltexco/public_html/felix/wp-includes/rest-api/class-wp-rest-server.php on line 1758

Warning: Cannot modify header information - headers already sent by (output started at /home/feltexco/public_html/felix/wp-content/plugins/google-maps-ready/modules/options/models/options.php:16) in /home/feltexco/public_html/felix/wp-includes/rest-api/class-wp-rest-server.php on line 1758

Warning: Cannot modify header information - headers already sent by (output started at /home/feltexco/public_html/felix/wp-content/plugins/google-maps-ready/modules/options/models/options.php:16) in /home/feltexco/public_html/felix/wp-includes/rest-api/class-wp-rest-server.php on line 1758
{"id":84,"date":"2014-02-25T17:46:57","date_gmt":"2014-02-25T20:46:57","guid":{"rendered":"http:\/\/feltex.com.br\/felix\/?p=84"},"modified":"2014-10-15T11:47:41","modified_gmt":"2014-10-15T14:47:41","slug":"alo-mundo-java-web-eclipse","status":"publish","type":"post","link":"https:\/\/www.feltex.com.br\/felix\/alo-mundo-java-web-eclipse\/","title":{"rendered":"Al\u00f4 Mundo Java Web – Eclipse"},"content":{"rendered":"

Hoje criaremos um projeto Web Simples com o Eclipse. Ferramentas:
\n


\n 1. Eclipse Keppler
\n 2. Apache Tomcat – 7<\/p>\n

<\/p>\n

Abra o seu Eclipse e vamos seguir o passo a passo a seguir:<\/p>\n

1. (Ctrl + N) ou Menu File => New => Other => Dynamic Web Project<\/p>\n

\"Al\u00f4<\/a><\/p>\n

Em seguida preencha os campos:<\/p>\n

\"Al\u00f4<\/a><\/p>\n

Observe as configura\u00e7\u00f5es existentes.
\nTarget Runtime = Servidor de aplica\u00e7\u00e3o que ser\u00e1 utilizado
\n (Caso voc\u00ea n\u00e3o tenha um servidor instalado veja o cap\u00edtulo \u201cInstala\u00e7\u00e3o e configura\u00e7\u00e3o do TOMCAT\u201d)
\nDynamic web module version = Vers\u00e3o utilizada para especifica\u00e7\u00e3o da Servlet\/jsp.
\nConfiguta\u00e7\u00e3o associa ao projeto as configura\u00e7\u00f5es do servidor informado.
\nEAR membership = Caso queira associar o projeto a um projeto corporativo.
\nSelecione next<\/p>\n

\"Al\u00f4<\/a><\/p>\n

Configura\u00e7\u00e3o onde ser\u00e3o criadas as classes.<\/p>\n

\"Al\u00f4<\/a><\/p>\n

ContextRoot \u00e9 o nome que ser\u00e1 chamada a sua aplica\u00e7\u00e3o.
\n\tEx. http:\/\/localhost:8080\/ControleFinanceiro
\nContent directory = onde ser\u00e3o criadas as p\u00e1ginas.
\nCaso voc\u00ea marque a op\u00e7\u00e3o \u201cGenerate web.xml deployment descriptor\u201d ser\u00e1 criado um arquivo onde ser\u00e3o adicionadas algumas configura\u00e7\u00f5es da aplica\u00e7\u00e3o como Servlet, Filter, P\u00e1gina Inicial padr\u00e3o, controle de erros entre outras. Este arquivo \u00e9 muito importante para configura\u00e7\u00e3o de frameworks como Struts, JSF, Spring
\nDeixe esta op\u00e7\u00e3o marcada.<\/strong>
\nSelecione Finish.
\nO resultado esperado \u00e9 a seguinte tela:<\/p>\n

\"Al\u00f4<\/a><\/p>\n

Pronto. Projeto Criado.
\nVamos criar nossa p\u00e1gina principal. Chamada \u201cindex.jsp\u201d.
\nSelecione o projeto, clique com o bot\u00e3o direito New => JSP File<\/p>\n

\"Al\u00f4<\/a><\/p>\n

Apenas digite o nome do arquivo e selecione \u201cFinish\u201d<\/p>\n

\"Al\u00f4<\/a><\/p>\n

No arquivo index.jsp que foi aberto escreve uma mensagem conforme a imagem abaixo.<\/p>\n

\"Al\u00f4<\/a><\/p>\n

Vamos executar o projeto com a sauda\u00e7\u00e3o inicial.
\nSelecione sua p\u00e1gina index.jsp com o bot\u00e3o direito Run As” => “Run on Server”<\/p>\n

\"Al\u00f4<\/a><\/p>\n

\"Al\u00f4<\/a><\/p>\n

Marque a op\u00e7\u00e3o “Always use this server when running this project\u201d isso far\u00e1 que o Eclipse sempre utilize esse mesmo servidor nas pr\u00f3ximas execu\u00e7\u00f5es.<\/p>\n

O resultado deve ser algo como a tela abaixo:<\/p>\n

\"Al\u00f4<\/a><\/p>\n

***Dica: Para visualizar o resultado no Browser padr\u00e3o selecione \u201cWindows => Web Browser\u201d Voc\u00ea pode escolher o Browser padr\u00e3o na op\u00e7\u00e3o \u201cDefault system web Browser\u201d ou outro da lista.<\/p>\n

\"Al\u00f4<\/a><\/p>\n

Execute novamente o projeto e sua aplica\u00e7\u00e3o ser\u00e1 aberta em outro Browser.<\/p>\n

Muito bem. Projeto criado e agora \u00e9 hora de iniciar a constru\u00e7\u00e3o dos elementos b\u00e1sicos do projeto. Vamos agora criar um Servlet. Que \u00e9, de forma resumida, uma classe Java que recebe e responde a requisi\u00e7\u00f5es HTTP<\/p>\n

M\u00e3os \u00e0 obra: Clique com o bot\u00e3o direito no projeto.<\/p>\n

\"Al\u00f4<\/a><\/p>\n

*Alternativamente voc\u00ea pode digitar Ctrl + N. Em seguida digite Servlet.<\/p>\n

Ser\u00e1 aberta a seguinte tela:<\/p>\n

\"Al\u00f4<\/a><\/p>\n

Simples. Selecione Next.
\n Preencha os campos como a tela abaixo, conforme a imagem:<\/p>\n

\"Al\u00f4<\/a><\/p>\n

Selecione Next.<\/p>\n

\"Al\u00f4<\/a><\/p>\n

Caso seja necess\u00e1rio passar par\u00e2metro de inicializa\u00e7\u00e3o adicione atrav\u00e9s do bot\u00e3o Add.
\nO campos “description” pode ficar vazio, pois representa uma informa\u00e7\u00e3o sobre a o par\u00e2metro.<\/p>\n

\"Al\u00f4<\/a><\/p>\n

Selecione Next. Nesta tela deixe marcada as op\u00e7\u00f5es de “doGet” e “doPost” conforme imagem abaixo.<\/p>\n

\"Al\u00f4<\/a><\/p>\n

Agora selecione “Finish”. Ent\u00e3o sua classe Servlet ser\u00e1 criada.<\/p>\n

No m\u00e9todo “doGet” adicione o seguinte c\u00f3digo: <\/p>\n

\r\ndoPost(request, response); \r\n<\/pre>\n

Isso far\u00e1 com que toda requisi\u00e7\u00e3o recebida via HTTP GET seja repassada para o m\u00e9todo doPost que processar\u00e1 os dados.<\/p>\n

No doPost adicione o seguinte c\u00f3digo:<\/p>\n

\r\n   PrintWriter out = response.getWriter();\t\t\r\n   out.print(\"Mensagem do Dia!\");\r\n<\/pre>\n

N\u00e3o esque\u00e7a de salvar as altera\u00e7\u00f5es. “Ctrl + S”<\/p>\n

Pronto! C\u00f3digo finalizado. Vamos rodar!<\/p>\n

Selecione o seu servlet. Clique com o o bot\u00e3o Direito e selecione “Run As => Run on Server”<\/p>\n

Voc\u00ea ver\u00e1 o seguinte resultado:<\/p>\n

\"Al\u00f4<\/a><\/p>\n

Amigos por hoje \u00e9 s\u00f3. E vida que segue!<\/strong><\/p>\n

Links relacionados<\/h2>\n

Como aprender Java<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"

Hoje criaremos um projeto Web Simples com o Eclipse. Ferramentas: 1. Eclipse Keppler 2. Apache Tomcat – 7<\/p>\n","protected":false},"author":1,"featured_media":133,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0},"categories":[1,4,2],"tags":[],"yoast_head":"\nAl\u00f4 Mundo Java Web \u2013 Eclipse<\/title>\n<meta name=\"description\" content=\"Al\u00f4 Mundo Java Web \u2013 Eclipse\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.feltex.com.br\/felix\/alo-mundo-java-web-eclipse\/\" \/>\n<meta property=\"og:locale\" content=\"pt_BR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Al\u00f4 Mundo Java Web \u2013 Eclipse\" \/>\n<meta property=\"og:description\" content=\"Al\u00f4 Mundo Java Web \u2013 Eclipse\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.feltex.com.br\/felix\/alo-mundo-java-web-eclipse\/\" \/>\n<meta property=\"og:site_name\" content=\"Aprenda Java\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/feltex.br\" \/>\n<meta property=\"article:published_time\" content=\"2014-02-25T20:46:57+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2014-10-15T14:47:41+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.feltex.com.br\/felix\/wp-content\/uploads\/2014\/02\/Java-Web-e1393417654672.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"225\" \/>\n\t<meta property=\"og:image:height\" content=\"225\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:label1\" content=\"Escrito por\" \/>\n\t<meta name=\"twitter:data1\" content=\"Andr\u00e9 F\u00e9lix\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. tempo de leitura\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.feltex.com.br\/felix\/#website\",\"url\":\"https:\/\/www.feltex.com.br\/felix\/\",\"name\":\"Aprenda Java\",\"description\":\"Cursos de java, SQL e Engenharia de Software\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.feltex.com.br\/felix\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"pt-BR\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.feltex.com.br\/felix\/alo-mundo-java-web-eclipse\/#primaryimage\",\"inLanguage\":\"pt-BR\",\"url\":\"https:\/\/www.feltex.com.br\/felix\/wp-content\/uploads\/2014\/02\/Java-Web-e1393417654672.jpg\",\"contentUrl\":\"https:\/\/www.feltex.com.br\/felix\/wp-content\/uploads\/2014\/02\/Java-Web-e1393417654672.jpg\",\"width\":225,\"height\":225},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.feltex.com.br\/felix\/alo-mundo-java-web-eclipse\/#webpage\",\"url\":\"https:\/\/www.feltex.com.br\/felix\/alo-mundo-java-web-eclipse\/\",\"name\":\"Al\\u00f4 Mundo Java Web \\u2013 Eclipse\",\"isPartOf\":{\"@id\":\"https:\/\/www.feltex.com.br\/felix\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.feltex.com.br\/felix\/alo-mundo-java-web-eclipse\/#primaryimage\"},\"datePublished\":\"2014-02-25T20:46:57+00:00\",\"dateModified\":\"2014-10-15T14:47:41+00:00\",\"author\":{\"@id\":\"https:\/\/www.feltex.com.br\/felix\/#\/schema\/person\/1e49f842c6254b4561b66ccf573c2069\"},\"description\":\"Al\\u00f4 Mundo Java Web \\u2013 Eclipse\",\"breadcrumb\":{\"@id\":\"https:\/\/www.feltex.com.br\/felix\/alo-mundo-java-web-eclipse\/#breadcrumb\"},\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.feltex.com.br\/felix\/alo-mundo-java-web-eclipse\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.feltex.com.br\/felix\/alo-mundo-java-web-eclipse\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Al\\u00f4 Mundo Java Web – Eclipse\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.feltex.com.br\/felix\/#\/schema\/person\/1e49f842c6254b4561b66ccf573c2069\",\"name\":\"Andr\\u00e9 F\\u00e9lix\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.feltex.com.br\/felix\/#personlogo\",\"inLanguage\":\"pt-BR\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d2d9cc82cab40245e6f803982b1448e6?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d2d9cc82cab40245e6f803982b1448e6?s=96&r=g\",\"caption\":\"Andr\\u00e9 F\\u00e9lix\"},\"sameAs\":[\"http:\/\/www.feltex.com.br\"],\"url\":\"https:\/\/www.feltex.com.br\/felix\/author\/andre.felix\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Al\u00f4 Mundo Java Web \u2013 Eclipse","description":"Al\u00f4 Mundo Java Web \u2013 Eclipse","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:\/\/www.feltex.com.br\/felix\/alo-mundo-java-web-eclipse\/","og_locale":"pt_BR","og_type":"article","og_title":"Al\u00f4 Mundo Java Web \u2013 Eclipse","og_description":"Al\u00f4 Mundo Java Web \u2013 Eclipse","og_url":"https:\/\/www.feltex.com.br\/felix\/alo-mundo-java-web-eclipse\/","og_site_name":"Aprenda Java","article_publisher":"https:\/\/www.facebook.com\/feltex.br","article_published_time":"2014-02-25T20:46:57+00:00","article_modified_time":"2014-10-15T14:47:41+00:00","og_image":[{"width":225,"height":225,"url":"https:\/\/www.feltex.com.br\/felix\/wp-content\/uploads\/2014\/02\/Java-Web-e1393417654672.jpg","type":"image\/jpeg"}],"twitter_misc":{"Escrito por":"Andr\u00e9 F\u00e9lix","Est. tempo de leitura":"3 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/www.feltex.com.br\/felix\/#website","url":"https:\/\/www.feltex.com.br\/felix\/","name":"Aprenda Java","description":"Cursos de java, SQL e Engenharia de Software","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.feltex.com.br\/felix\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"pt-BR"},{"@type":"ImageObject","@id":"https:\/\/www.feltex.com.br\/felix\/alo-mundo-java-web-eclipse\/#primaryimage","inLanguage":"pt-BR","url":"https:\/\/www.feltex.com.br\/felix\/wp-content\/uploads\/2014\/02\/Java-Web-e1393417654672.jpg","contentUrl":"https:\/\/www.feltex.com.br\/felix\/wp-content\/uploads\/2014\/02\/Java-Web-e1393417654672.jpg","width":225,"height":225},{"@type":"WebPage","@id":"https:\/\/www.feltex.com.br\/felix\/alo-mundo-java-web-eclipse\/#webpage","url":"https:\/\/www.feltex.com.br\/felix\/alo-mundo-java-web-eclipse\/","name":"Al\u00f4 Mundo Java Web \u2013 Eclipse","isPartOf":{"@id":"https:\/\/www.feltex.com.br\/felix\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.feltex.com.br\/felix\/alo-mundo-java-web-eclipse\/#primaryimage"},"datePublished":"2014-02-25T20:46:57+00:00","dateModified":"2014-10-15T14:47:41+00:00","author":{"@id":"https:\/\/www.feltex.com.br\/felix\/#\/schema\/person\/1e49f842c6254b4561b66ccf573c2069"},"description":"Al\u00f4 Mundo Java Web \u2013 Eclipse","breadcrumb":{"@id":"https:\/\/www.feltex.com.br\/felix\/alo-mundo-java-web-eclipse\/#breadcrumb"},"inLanguage":"pt-BR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.feltex.com.br\/felix\/alo-mundo-java-web-eclipse\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.feltex.com.br\/felix\/alo-mundo-java-web-eclipse\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Al\u00f4 Mundo Java Web – Eclipse"}]},{"@type":"Person","@id":"https:\/\/www.feltex.com.br\/felix\/#\/schema\/person\/1e49f842c6254b4561b66ccf573c2069","name":"Andr\u00e9 F\u00e9lix","image":{"@type":"ImageObject","@id":"https:\/\/www.feltex.com.br\/felix\/#personlogo","inLanguage":"pt-BR","url":"https:\/\/secure.gravatar.com\/avatar\/d2d9cc82cab40245e6f803982b1448e6?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d2d9cc82cab40245e6f803982b1448e6?s=96&r=g","caption":"Andr\u00e9 F\u00e9lix"},"sameAs":["http:\/\/www.feltex.com.br"],"url":"https:\/\/www.feltex.com.br\/felix\/author\/andre.felix\/"}]}},"_links":{"self":[{"href":"https:\/\/www.feltex.com.br\/felix\/wp-json\/wp\/v2\/posts\/84"}],"collection":[{"href":"https:\/\/www.feltex.com.br\/felix\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.feltex.com.br\/felix\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.feltex.com.br\/felix\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.feltex.com.br\/felix\/wp-json\/wp\/v2\/comments?post=84"}],"version-history":[{"count":23,"href":"https:\/\/www.feltex.com.br\/felix\/wp-json\/wp\/v2\/posts\/84\/revisions"}],"predecessor-version":[{"id":742,"href":"https:\/\/www.feltex.com.br\/felix\/wp-json\/wp\/v2\/posts\/84\/revisions\/742"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.feltex.com.br\/felix\/wp-json\/wp\/v2\/media\/133"}],"wp:attachment":[{"href":"https:\/\/www.feltex.com.br\/felix\/wp-json\/wp\/v2\/media?parent=84"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.feltex.com.br\/felix\/wp-json\/wp\/v2\/categories?post=84"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.feltex.com.br\/felix\/wp-json\/wp\/v2\/tags?post=84"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}