servlets...http bem-vindo.html java runtime environ. (jre) tomcat /gerenciador bem vindo no …
TRANSCRIPT
HTTPbem-vindo.html
Java Runtime Environ. (JRE)
http://localhost:8080
/gerenciador
request
response
Tomcat
HTTPbem-vindo.html
Java Runtime Environ. (JRE)
Tomcathttp://localhost:8080
/gerenciador
http://localhost:8080/gerenciador/bem-vindo.html
Bem vindo no curso Servlets da Alura!
request
response
HTTPbem-vindo.html
Java Runtime Environ. (JRE)
Tomcathttp://localhost:8080
/gerenciador
http://localhost:8080/gerenciador/bem-vindo.html
Bem vindo no curso Servlets da Alura!
request
response
Servlet
HTTP POST/GETformNovaEmpresa.html
JRE
Tomcathttp://localhost:8080
/gerenciador
http://localhost:8080/gerenciador/novaEmpresa
<html><body>Empresa Alura cadastrada com sucesso</body></html>
request
response
Servlet
HTTP POST/GET
JRE
Tomcathttp://localhost:8080
/gerenciador
request
response
Servlet
JSP
JSP - Java Server Page
Tomcat
HTTP POST/GET
http://localhost:8080
/gerenciador
request
response
Servlet
JSP
Dispatcher
Modelo
Tomcat
HTTP POST/GET
http://localhost:8080
/gerenciador
request
response
Servlet
JSPJSTL + EL
Dispatcher
Modelo
JSTL (Java Standard Tag Library)
core - controle de fluxo
fmt - formatação / i18n (internacionalização)
sql - executar SQL
xml - gerar XML
JSTL (Java Standard Tag Library)
core - controle de fluxo<%@ taglib uri = "http://java.sun.com/jsp/jstl/core" prefix = "c"%>
fmt - formatação / i18n (internacionalização)<%@ taglib uri = "http://java.sun.com/jsp/jstl/fmt" prefix = "fmt"%>
Tomcathttp://localhost:8080
/gerenciador
request
response
Servlet
JSPJSTL + EL
Dispatcher
Modelo
requestServlet
response com redirect
Tomcathttp://localhost:8080
/gerenciador
response
Servlet
JSPJSTL + EL
Dispatcher
Modelo
requestServlet
Dispatcher
CRUD
Create - criação do registro / objeto
Read - leitura de registro(s), objeto(s)
Update - atualizar registro / objeto
Delete - remover registro / objeto
Tomcathttp://localhost:8080
/gerenciador
ListaEmpresasSer.
RemoveEmpresaSer.
Modelo
/novaEmpresaNovaEmpresaServlet
/listaEmpresas
AlterarEmpresasSer.
/removeEmpresa
/alterarEmpresa
Tomcathttp://localhost:8080
/gerenciador
request
response
ListaEmpresaServlet
JSPJSTL + EL
Dispatcher
Modelo
requestRemoveEmpresa
Servletresponse com redirect
Tomcathttp://localhost:8080
/gerenciador
ListaEmpresaServlet
JSPJSTL + EL
Dispatcher
Modelo
AlteraEmpresaServlet
MostraEmpresaServlet
JSPDispatcher
Tomcat
HTTP
http://localhost:8080
/gerenciador
Servlet
JSPJSTL + EL
Dispatcher
Modelo Banco
HTMLCSSJS
SQLJDBCJPA
Spring MVC
HTTP POST/GET
JRE
Tomcathttp://localhost:8080
/gerenciador
request
response
Servlet
Inversao de controle -> IOC