Hi Russell,

Thanks. But I don't understand your solution. See below.

Axel         Lannion/France

> -----Original Message-----
> From: Russell Gold [SMTP:[EMAIL PROTECTED]]
> Sent: vendredi 2 mars 2001 13:42
> To:   [EMAIL PROTECTED]
> Subject:      Re: servlet to set the target for the frame in the browser
>
> Bartsch Axel <[EMAIL PROTECTED]> wrote:
> >Does anybody know if it is possible for a servlet to setup the target for the frame 
>of the browser during processing?
> >
> >The situation:
> >The user clicks to load a page: normally the page is loaded into the center frame:
> >but if the session has expired a login page shall be shown and this page should be 
>loaded into the _top frame (=the complete browser window).
> >
> >Now I am doing this with the following JAVASCIPT command set in the login page:
> >
> >if (window != top) top.location.href = location.href;
> >
> >It works: but the problem is that this JAVASCRIPT command leads to a new servlet 
>request:
> >and if you had originally used a POST request all the posted data is lost and I 
>also need that data for the login page.
> >With a GET request it works.
> >
> >So is there a solution where the servlet during its processing can change the frame 
>target e.g. in case the session has expired?
>
> Remember the a servlet only sends content when requested. It is the HTTP request 
>that specifies where the result will be displayed. That means that you have little 
>choice but to do as you are (although you may not need to use JavaScript): when a 
>page request is made with an expired session, the response will be a page that simply 
>requests the login page in the _top frame.
        [Bartsch Axel]  the situation: a request using target=x (not equal _top) 
arrives at my servlet, the servlet finds out that the session has expired and wants to 
send the login page in the response: and the servlet wants this page in target=_top. 
So how can the servlet change the target in the response?

> As for the POST, remember that the information should be available to the servlet, 
>so it can certainly populate the login page redirector appropriately.
>
>
> --
> ------------------------------------------------------------------------
> Russell Gold                     | "... society is tradition and order
> [EMAIL PROTECTED]                 | and reverence, not a series of cheap
>                                  | bargains between selfish interests."
> http://www.httpunit.org          |   - Poul Anderson, "Iron"
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to