Escolar Documentos
Profissional Documentos
Cultura Documentos
abre conexo
Cliente
(Navegador)
GET /index.html
pgina
Servidor
www.furb.br
fecha conexo
Cabealhos HTTP
Mtodos HTTP
Lado-cliente:
Lado-servidor: (requisio-resposta)
HTML
Servlets
Java Server Pages (JSP)
Servlet
JSP
<html>
<head><title>Oi Mundo</title></head>
<body>Al Mundo</body>
</html>
Execuo de Servlet
Servlet
Cliente
Servlet
JSP
<body>
<h1>Exemplo de JSP</h1>
<%for (int x = 0; x < 10; x++) {%>
<b>Repetindo</b><br/>
<%}%>
</body>
<body>
<h1>Exemplo de JSP</h1>
<%for (int x = 0; x < 10; x++) {%>
<b>Repetindo</b><br/>
<%}%>
</body>
exemplo.jsp
exemplo_jsp.java
....
out.write("<body>\r\n");
out.write("<h1>Exemplo de JSP</h1>\r\n");
for (int x = 0; x < 10; x++) {
out.write("\r\n");
out.write(" <b>Repetindo</b><br/>\r\n");
}
out.write("\r\n");
out.write("\r\n");
out.write("</body>");
....
Apache Tomcat
Bibliotecas
Configuraes da aplicao
Iniciando o Tomcat
Se no existir :
http://localhost:8080
Configurao de Usurios
Desligar o servidor
Abrir arquivo \conf\tomcat-users.xml
Adicionar
<role rolename="manager"/>
<role rolename="admin"/>
<user username="seunome" password=""
roles="admin,manager"/>
1.
HTML
Links
<a href=pagina1.jsp>Vai para a pgina 1</a>
<head>
<title>Um ttulo</title>
</head>
<body>
Informao apresentada no navegador
</body>
</html>
Prof. Adilson Vahldick
Formulrios
Formulrios
<a href=pagina2.jsp>Manda</a>
</form>
Prof. Adilson Vahldick
Botes
Formulrios
</form>
Formulrios
Caixas de Verificao
Senha:
<input type="password"
name= "senhausu" />
Campo oculto:
<input type="hidden" name="codigo" value="1"/>
Boto de Radio
Seleo
<select name="diaSemana">
<option value="dom">Domingo</option>
<option value="sex" selected>Sexta</option>
<option value="sab">Sbado</option>
</select>
<select name="diaSemana" size = 3 multiple>
<option value="dom">Domingo</option>
<option value="sex" selected>Sexta</option>
<option value="sab">Sbado</option>
</select>
Prof. Adilson Vahldick
Tabelas
<table border=1>
<tr>
<td> cel1 </td><td> cel2 </td>
</tr>
<tr>
<td colspan=2>super clula</td>
</tr>
</table>
10