[RESOLVIDO]redirecionamento e Session no JSF2

6 respostas
E

Pessoal,

Tenho o seguinte,

PAGINA1
PAGINA2

e gostaria que assim que a PAGINA1 carregasse, redirenciosse para a PAGINA2 e
na PAGINA1, gostaria de incluir uma sessao antes de redirencionar para a PAGINA2

Estou usando JSF 2.0

alguem pode me dar uma luz ??

Obrigado

6 Respostas

Hebert_Coelho

Pra que raios você quer carregar a página 1 então?! :shock: :shock: :shock:

tmvolpato

Essa página 1 seria
a página default .html
chamando uma pag .jsf
dentro dela…

seria isso?

se não for, estou na msma do Hebert - pra que isso???

marcelo.silva

Tente usar o preRenderEvent…

E

isso mesmo …tmvolpato, eu teria a seguinte estrutura

cliente de campinas (Pasta)
default.xhtml
****aqui carregaria a sessao deste cliente de campinas e faria o rendirencionamento para a index (da pasta Page)

Page(Pasta)
Index.xhtml

Alguem pode me ajduar ?

E

fiz dessa forma :

<%@ 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">
<%
   session.setAttribute( "name_emp", "VOTUPORANGA" );
%>


<html>
<head>
<meta http-equiv="REFRESH" content="0;url=/UniplanWeb-war/pages/login.jsf">
<title>Insert title here</title>
</head>
<body>

    Hello, <%= session.getAttribute( "name_emp" ) %>
</body>
</html>
Hebert_Coelho
evandro_araujo:
fiz dessa forma :
<%@ 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">
<%
   session.setAttribute( "name_emp", "VOTUPORANGA" );
%>


<html>
<head>
<meta http-equiv="REFRESH" content="0;url=/UniplanWeb-war/pages/login.jsf">
<title>Insert title here</title>
</head>
<body>

    Hello, <%= session.getAttribute( "name_emp" ) %>
</body>
</html>
Pesquise sobre sendRedirect do httpResponse.
Criado 17 de janeiro de 2013
Ultima resposta 18 de jan. de 2013
Respostas 6
Participantes 4