Craig,

Is there way using RequestDispatcher or  sendReDirect()   to send a page to
particular frame.

For example.  sendRedirect("index.html" target=_top); 

-_Anand


-----Original Message-----
From: Rick Bosch [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 29, 2000 3:32 PM
To: [EMAIL PROTECTED]
Subject: Re: send redirect question


if I have a bean that is called from a jsp and has the call

        if (!(cookie.tempContains("loggedin"))){
                try{
                    String
param=(request.getParameter("show")!=null)?"?show="+request.getParameter("sh
ow"):"";
                    response.sendRedirect("index.jsp"+param);
                    commit=true;
                }catch(IOException e){
                    log.write("Problem launching"+e.getMessage());
                }
        }else{

and in my jsp 

<jsp:useBean id="mybean" class="actv.login.PickDir" />
<%
    mybean.init( request,  response);
    if(mybean.commit){return;}
%>
<html>
<head> 

However we have found that some versions of ie if they mess with the back
button and up with messed up pages (described below).

1) how can i fix it?

2) Then would you say it is not safe to redirect from a bean that you have
pass a refrence to http response?



thanks
-rick

> From: "Craig R. McClanahan" <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> Date: Tue, 28 Nov 2000 12:45:46 -0800
> To: [EMAIL PROTECTED]
> Subject: Re: send redirect question
> 
> Rick Bosch wrote:
> 
>> we have several jsp pages that call beans.  Some beans for one reason or
>> another will redirect a user to another page, howver in some cases its
>> possible for a redirect to occur and if the logic of the bean is to
continue
>> writing after a reddirect the client get messed up pages usually the
>> original then some http headers and then the new page.  How is it jsp
pages
>> are somehow "aware" of a redirect but if i call a redirect from a bean it
>> seems to be ignored???
>> 
> 
> Deep down, a JSP page is just a Java class.  And the Java language has no
> concept like the setjmp()/longjmp() combination of C, where you can change
the
> logical flow of control with what amounts to a "go to" statement to a
> completely
> different method in a completely different source file.
> 
> When you call response.sendRedirect() -- or RequestDispatcher.forward(),
which
> has the same basic issue -- control will ultimately be returned to your
page
> when the method you just called returns.  It is up to you to add a
"return"
> statement afterwards, to stop creating the remainder of the current page.
> 
> The only time that this is done for you by the container is when you use
> <jsp:forward>, or execute a JSP custom tag that tells the container to
skip
> the
> remainder of the current page.
> 
>> 
>> thanks
>> -rick
> 
> Craig McClanahan
> 

Reply via email to