Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Desenvolvimento web em java com JSP e Servlets

19,488 views

Published on

Palestrada ministrada na FATENE(Faculdade de Tecnologia do Nordeste) em junho de 2010 para a turma de servidores web do prof. Marcondes Alexandre.

Published in: Technology, Education
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/qURD } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/qURD } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/qURD } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/qURD } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/qURD } ......................................................................................................................... Download doc Ebook here { https://soo.gd/qURD } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THAT BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book that can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer that is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story That Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money That the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths that Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THAT BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book that can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer that is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story That Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money That the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths that Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Desenvolvimento web em java com JSP e Servlets

  1. 1. <ul><li>IGO COELHO </li></ul><ul><li>http://twitter.com/igocoelho </li></ul><ul><li>http://www.igocoelho.com.br </li></ul><ul><li>http://www.javace.org </li></ul><ul><li>[email_address] </li></ul>DESENVOLVIMENTO PARA WEB EM JAVA COM SERVLET E JSP FATENE 06/2010
  2. 2.
  3. 3. - Java e JEE - HTTP - Tomcat - Servlet - JSP - TagLib AGENDA
  4. 4. Java e JEE
  5. 5. 1991 - Projeto Green 1992 - Protótipo *7, Duke e Linguagem OAK 1993 - Mosaic o primeiro navegador web 1995 - OAK passa a ser chamado de Java 2007 - Java open source 2009 - Sun é comprada pela Oracle A HISTÓRIA
  6. 6. 1996 - Java 1.0 1997 - Java Development Kit 1.1 1998 - Java 2 Platform 1.2 2000 - Java 2 Platform 1.3 2002 - Java 2 Platform 1.4 2004 - Java 2 Platform 1.5 (Tiger ou Java 5) 2006 - Java 6 (Mustang) ???? - Java 7 (Dolphin) http://en.wikipedia.org/wiki/Java_version_history A EVOLUÇÃO
  7. 7. COMO FUNCIONA
  8. 8. A PLATAFORMA
  9. 9. - Servlets - JSP - JSF (desenvolvimento web baseado em componentes) - JTA (padroniza o tratamento de transações dentro de uma aplicação Java) - JPA (padroniza o acesso a banco de dados através de mapeamento Objeto/Relacional) - EJB (utilizados no desenvolvimento de componentes de software) - JCA (padroniza a ligação a aplicações legadas) - JMS (troca de mensagens) - JAX-* (xml, SOAP e muito mais) API JEE
  10. 10. HTTP
  11. 11. - Hypertext Transfer Protocol - Seu uso para a obtenção de recursos levou ao estabelecimento da WWW - Primeira versão (HTTP/0.9) é de 1990 - De 1992 a 1996 foi desenvolvida a versão 1.0 - Em 1999 foi liberada a versão 1.1 - Fica na camada de aplicação segundo o modelo OSI - Trafega sobre o protocolo TCP / IP - A comunicação entre o cliente e o servidor é por meio de mensagens - Não guarda estado entre as trocas de mensagens HTTP
  12. 12. Possui 8 métodos que indicam a ação a ser realizada no recurso especificado - GET (Solicita um recurso) - HEAD (Solicita metainformações de um recurso) - POST (Envia dados para serem processados) - PUT (Envia um recurso) - DELETE (Excluir o recurso) - TRACE (Ecoa a requisição) - OPTIONS (Recupera os métodos que o servidor aceita) - CONNECT (Uso com proxy para túnel SSL) HTTP
  13. 13. COMO FUNCIONA GET / HTTP/1.1 Host: www.google.com User-Agent: Mozilla/5.0 (Windows; pt-BR; rv:1.9.0.6) Firefox/3.0.6 Accept: text/html,application/xhtmlxml,application/xml;q=0.9,* *;q=0.8 Accept-Language: pt-br,pt;q=0.8,en-us;q=0.5,en;q=0.3 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Bom dia Google.com, Gostaria de ler sua página. Estou usando o navegador Firefox na versão 3.0.6. No momento eu aceito HTML. Gostaria de receber o conteúdo em português, mas também entendo inglês. Uso o padrão de caracteres (letras) ISO-8859 e UTF-8.
  14. 14. COMO FUNCIONA HTTP/1.1 200 OK Location: http://www.google.com.br / Cache-Control: private Content-Type: text/html; charset=UTF-8 Date: Fri, 11 Jun 2010 19:12:34 GMT Content-Length: 438 <html> ... </html> Aqui é o Google.com.br. Estou enviando a página que pediu. Você pode guardar as informações e usa-las em outras visitas. Estou enviando apenas texto e HTML como você pediu. Essa carta foi feita as 19:12:34 horas do dia 11/06/2010. O conteúdo é formado por 438 letras, segue: ...
  15. 15. Tomcat
  16. 16. - Container Servlet/JSP mais conhecido entre os desenvolvedores dessas tecnologias. - Desenvolvido e mantido pela Apache Software Faundation, sua distribuição é de livre utilização, possuindo seu código-fonte aberto. - Oficialmente endossado como a implementação de referência para as tecnologias JSP e Servlet. - Tem a capacidade de atuar também como servidor web, ou pode funcionar integrado a um servidor web dedicado como o Apache ou o IIS. TOMCAT
  17. 17. COMO FUNCIONA
  18. 18. ESTRUTURA BÁSICA
  19. 19. Mão na massa
  20. 20. Servlet
  21. 21. - O Servlet foi introduzido pela Sun Microsystems em 1996, aprimorando a funcionalidade de servidores da Web. - É considerado eficiente para desenvolver soluções baseadas na Web, interagir com o banco de dados em favor de um cliente, gerar dinamicamente documentos HTML personalizados a serem exibidos por navegadores e manter informações de sessão exclusivas de cada cliente. SERVLET
  22. 22. - Toda servlet é basicamente uma classe que processa requisições e respostas dinâmicamente. - Uma Servlet necessita de um container Web para ser executado. - Uma servlet funciona como um pequeno servidor que recebe chamadas de diversos clientes. - Uma primeira idéia da servlet seria que cada uma delas é responsável por uma página, sendo que ela lê dados da requisição do cliente e responde com outros dados (html, gif etc). SERVLET
  23. 23. - Resumindo, cada servlet é um objeto java que recebe tais requisições (request) e retorna algo (response), como por exemplo uma página html ou uma imagem do formato jpg. - Diversas requisições podem ser feitas à uma mesma servlet ao mesmo tempo em um único servidor, por isso ela é mais rápida que um programa CGI comum. A especificação da servlet cita algumas vantagens que possui sobre o antigo CGI. SERVLET
  24. 24. < servlet > < servlet-name > OiMundo </ servlet-name > < servlet-class > br.com.fatene.OiMundo </ servlet-class > </ servlet > < servlet-mapping > < servlet-name > OiMundo </ servlet-name > < url-pattern > /OiMundo </ url-pattern > </ servlet-mapping > CRIANDO UM SERVLET - Extenda a classe javax.servlet.http.HttpServlet - Declare o Servlet no web.xml
  25. 25. Mão na massa
  26. 26. JSP
  27. 27. - JSP (JavaServer Pages) é uma tecnologia baseada em Java que simplifica o processo de desenvolvimento de sites da web dinâmicos. - Foi criada pela Sun Microsystems em junho de 1999 com o objetivo de simplificar a tecnologia Java Servlets, possuindo um suporte robusto e repleto de recursos Java no servidor, a fim de garantir uma plataforma estável e bem definida. JSP
  28. 28. COMO FUNCIONA
  29. 29. Mão na massa
  30. 30. TagLib
  31. 31. - É nada mais nada menos que uma biblioteca de tags customizadas que são utilizadas na composição de páginas JSP. - É uma biblioteca de “classes Java” que são utilizadas “na forma de tags” para auxiliar na geração de conteúdo dinâmico em uma página JSP. TAGLIB
  32. 32. - Nos ajudam a eliminar consideravelmente a utilização de scriptlets e redundância de código em páginas JSP. - Uma tag customizada JSP é composta basicamente por dois elementos: •  Uma classe Java sendo a sua implementação. •  Um arquivo “.tld” contendo os seus metadados – suas descrições . TAGLIB
  33. 33. Mão na massa
  34. 34. <ul><li>Obrigado !!! </li></ul>http://twitter.com/igocoelho http://www.igocoelho.com.br http://www.javace.org [email_address]

×