Melhor solução para validar uma sessão

0 respostas
Romildo_Paiter

E ai pessoal...

Beleza.... Bom seguinte, fazendo meus estudos por aqui. Gostaria que analisasem esse codigo para ver se essa é a melhor solução para fazer a checagem de uma Session valida.

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    
<%@ page isELIgnored="false" %>    
<%@ page language="java"%> 
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>    

<!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>Insert title here</title>
</head>
<body>
	<c:choose>
		<c:when test="${empty funcionario}">
			<c:redirect url="formulario-login.jsp"></c:redirect>
		</c:when>
		<c:otherwise>
			<html:form action="/adicionaContato" focus="contato.nome">
				Nome: <html:text property="contato.nome" /><br />
				E-mail: <html:text property="contato.email" /><br />
				Endereço: <html:text property="contato.endereco" /><br />
				<html:submit>Adicionar Contato</html:submit>
			</html:form>
		</c:otherwise>
	</c:choose>
</body>
</html>

Se não como e quais tecnicas devemos utilizar para ter um ambiente seguro se tratando das checagem das session.

Valew pessoal

Grande abraço a todos

--
Romildo Paiter

Criado 19 de fevereiro de 2010
Respostas 0
Participantes 1