INDEX.JSP
<%@page import="java.text.SimpleDateFormat"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Aplicativo de Mala Direta</title>
</head>
<body>
<h1>DAWJ - App Web Malling</h1>
<table>
<form action="sucesso.jsp" method="get">
<tr>
<td>Nome Completo:</td>
</tr>
<tr>
<td><input type="text" name="nome" />
</td>
</tr>
<tr>
<td>Sexo:</td>
<td>Data de Nascimento:</td>
</tr>
<tr>
<td><input type="radio" name="sexo" value="f" />Feminino</td>
<td><input type="text" name="data_nascimento" />
</td>
</tr>
<tr>
<td colspan="2"><input type="radio" name="sexo" value="m" />Masculino
</td>
</tr>
<tr>
<td colspan="2">E-mail.:</td>
</tr>
<tr>
<td colspan="2"><input name="email" type="text" />
</td>
</tr>
<tr>
<td><input type="reset" value="Limpar Campos" /></td>
<td><input type="submit" value="Cadastrar" /></td>
</tr>
</form>
</table>
</body>
</html>
SUCESSO.JSP
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.util.Date"%>
<%@page import="br.com.dawj.bean.Pessoa"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Cadastrado com Sucesso!</title>
</head>
<%
try {
String data = (String) request.getParameter("data_nascimento");
request.removeAttribute("data_nascimento");
Date dataf = new SimpleDateFormat("dd/MM/yyyy").parse(data);
session.setAttribute("data_nascimento",dataf);
System.out.println("Saida: " + dataf);
} catch(Exception e){
out.println(e.getMessage());
}
%>
<body>
<jsp:useBean id="people" class="br.com.dawj.bean.Pessoa">
<jsp:setProperty name="people" property="*" />
</jsp:useBean>
<h1>DAWJ - AppWebMalling</h1>
<p>O Registro Abaixo foi Gravado com Sucesso</p>
<table>
<tr>
<td>Nome: </td>
<td>${people.nome}</td>
</tr>
<tr>
<td>Sexo: </td>
<td>${people.sexo}</td>
</tr>
<tr>
<td>E-mail</td>
<td>${people.email}</td>
</tr>
<tr>
<td>Date de Nascimento: </td>
<td>${people.data_nascimento}</td>
</tr>
</table>
</body>
</html>
olha como fica :(
Alguem tem ideia? vlw