Hello the main issue you have is you want to trigger from an outside
navigation a jsf page and you want to preserve the session, correct?
I assume this here is hardcoded right? <frame
src="http://localhost:9080/InvestInform/login/iimnall.jsf"
name="anzeige" id="anzeige" title="anzeige" />
what you have to do is following, you have to create the link
dynamically and use:
response.encodeURL(encodedUrl)
no redirect is needed here, you will have lost the session already at
private void umleitenAufNeueZielseite(PhaseEvent event, String
> kontextStamm, String zielSeite)
What happens is following:
You trigger an external page here, page gets a session id assigned, then
you trigger a frame but you omit the session id, the frame then gets its
own session id, because you have a hardcoded link.
You have to drag in your session id to the link that jsf calls so that
jsf can recycle it.
the call should then look like<frame
src="http://localhost:9080/InvestInform/login/iimnall.jsf?jsessionId=....."
name="anzeige" id="anzeige" title="anzeige" />
It depends on the context you are in, if you already are in jsf or if.
But as I said do not create the link hardcoded use the el to
make the link and then delegate to response.encodeURL(...)
however also make sure that the server and browser allow cookies
otherwise the entire sessionid thing wont work
(since you know german
http://www.java-forum.org/allgemeines-ee/87463-funkt-encodeurl-auch-wenn-cookies-eingeschalten-sind.html)
Werner
Georg Füchsle schrieb:
Hallo Werner,
thanks for Your help.
But I have to ask once more:
thecall of 'response.encodeURL(encodedUrl)' doesnot change the url.
for the redirect I use the following funktion:
private void umleitenAufNeueZielseite(PhaseEvent event, String
kontextStamm, String zielSeite)
{
try
{
ExternalContext ectx =
event.getFacesContext().getExternalContext();
HttpServletResponse response =
(HttpServletResponse)ectx.getResponse();
String encodedUrl = kontextStamm + zielSeite;
encodedUrl = response.encodeURL(encodedUrl);
ectx.redirect(encodedUrl);
}
catch (IOException e)
{
log.error("Fehler bei der Weiterleitung!");
}
}
Was it this what you wanted to advice me?
Cheers
Georg
2009/8/28 Werner Punz <[email protected]>:
Werner Punz schrieb:
Georg Füchsle schrieb:
Hallo Werner , hallo Jan-Kees,
thank you for your answers.
- I do not redirect to another application but to another URL inside
the same application.
- I do not change from http to https or vice versa.
- Werner: I tried to youse handleNavigtion instead of redirect, but
unfortunately i didn't succeed as i got an exception. ( I asked this
in another request to this news group...)
But now I examined once more an found out another strange fact:
I loose the session only if the application is called out of a frame.
(The application should be embedded into the website of a customer
using a frameset :)
<frame src="http://localhost:9080/InvestInform/login/iimnall.jsf"
name="anzeige" id="anzeige" title="anzeige" />
Ok here is the issue, you basically change applications implicitely via
the usage of frames :-)
You probably should add your session id to the link.. via
response.encodeUrl you can get a valid url including the id :-)
Make sure you do that for all frame to frame navigations (inside a frame
you wont have to do that)
Werner
Ok Just to add something here, in your case with trying to call a JSF page
from an outside frame, a navigation case wont help you. Navigaton cases only
work within the same frame.
Werner