Re: Forward Cannot Be Achieved In One Step
Is your "Menu" actionforward the welcome screen you want to get to? And does your Action return an ActionForward to this? Caroline Jen wrote: Hi, I have the following code in the navbarMenu.jsp: LOGOUT and in the struts-config.xml, I have: and type="org.NameOfOrganization.signoff.LogoffAction"> name="success" path="/do/Menu"/> In the LogoffAction.java, I invalidate the session and I want the user to go back the welcome page. The problem is that it takes two steps for the user to go back to the welcome page - After the first click, the same screen remains in the browser. The only change is what is shown in the address bar. I have to click the LOGOFF button again and then the welcome page is displayed. What should I do to go back to the welcome page in one step? __ Do you Yahoo!? Exclusive Video Premiere - Britney Spears http://launch.yahoo.com/promos/britneyspears/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Brice D. Ruth Sr. IT Analyst Fiskars Brands, Inc. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Forward Cannot Be Achieved In One Step
The do/Menu "does" display my welcome page. The LOGOUT button and forward "does" eventually lead the visitor to the welcome page. The problem is that it takes two steps intead of going straight to the welcome page. Let me re-state my problem: I have the following code in the navbarMenu.jsp: LOGOUT and in the struts-config.xml, I have: and In the LogoffAction.java, I invalidate the session and I want the user to go back the welcome page. And The .article.Menu is my tile that displays the welcome page. The problem is that it takes two steps for the user to go back to the welcome page - After the first click, the same screen remains in the browser. The only change is what is shown in the address bar. I have to click the LOGOFF button "again" and then the welcome page is displayed. What should I do to go back to the welcome page in one step? --- "Ruth, Brice" <[EMAIL PROTECTED]> wrote: > Is your "Menu" actionforward the welcome screen you > want to get to? And > does your Action return an ActionForward to this? > > Caroline Jen wrote: > > >Hi, I have the following code in the > navbarMenu.jsp: > > > >LOGOUT > > > >and in the struts-config.xml, I have: > > > > > name="exit" > > path="/do/Logoff"/> > > > >and > > > > > path="/Logoff" > > > type="org.NameOfOrganization.signoff.LogoffAction"> > > > name="success" > > path="/do/Menu"/> > > > > > >In the LogoffAction.java, I invalidate the session > and > >I want the user to go back the welcome page. > > > >The problem is that it takes two steps for the user > to > >go back to the welcome page - After the first > click, > >the same screen remains in the browser. The only > >change is what is shown in the address bar. I have > to > >click the LOGOFF button again and then the welcome > >page is displayed. > > > >What should I do to go back to the welcome page in > one step? > > > >__ > >Do you Yahoo!? > >Exclusive Video Premiere - Britney Spears > >http://launch.yahoo.com/promos/britneyspears/ > > > >- > >To unsubscribe, e-mail: > [EMAIL PROTECTED] > >For additional commands, e-mail: > [EMAIL PROTECTED] > > > > > > > > -- > Brice D. Ruth > Sr. IT Analyst > Fiskars Brands, Inc. > > > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Forward Cannot Be Achieved In One Step
Caroline: ok, I didn't sleep enough last night so I may be blabbering(:(, but why don't you simply say: LOGOUT and lose the "forward" entry in your struts-config.xml? Geeta Caroline Jen wrote: > The do/Menu "does" display my welcome page. The > LOGOUT button and forward "does" eventually lead the > visitor to the welcome page. The problem is that it > takes two steps intead of going straight to the > welcome page. Let me re-state my problem: > > I have the following code in the navbarMenu.jsp: > > LOGOUT > > and in the struts-config.xml, I have: > > name="exit" >path="/do/Logoff"/> > > and > > path="/Logoff" >type="org.NameOfOrganization.signoff.LogoffAction"> >name="success" > path="/do/Menu"/> > > > In the LogoffAction.java, I invalidate the session and > I want the user to go back the welcome page. And > >path="/Menu" > name="menuForm" > > type="org.apache.struts.scaffold.ExistsAttributeAction" > parameter="application;HOURS"> > name="success" >path=".article.Menu"/> > name="failure" >path="/do/MenuCreate"/> > > The .article.Menu is my tile that displays the welcome > page. > > The problem is that it takes two steps for the user to > go back to the welcome page - After the first click, > the same screen remains in the browser. The only > change is what is shown in the address bar. I have to > click the LOGOFF button "again" and then the welcome > page is displayed. > > What should I do to go back to the welcome page in one > step? > > --- "Ruth, Brice" <[EMAIL PROTECTED]> wrote: > > Is your "Menu" actionforward the welcome screen you > > want to get to? And > > does your Action return an ActionForward to this? > > > > Caroline Jen wrote: > > > > >Hi, I have the following code in the > > navbarMenu.jsp: > > > > > >LOGOUT > > > > > >and in the struts-config.xml, I have: > > > > > > > > name="exit" > > > path="/do/Logoff"/> > > > > > >and > > > > > > > > path="/Logoff" > > > > > type="org.NameOfOrganization.signoff.LogoffAction"> > > > > > name="success" > > > path="/do/Menu"/> > > > > > > > > >In the LogoffAction.java, I invalidate the session > > and > > >I want the user to go back the welcome page. > > > > > >The problem is that it takes two steps for the user > > to > > >go back to the welcome page - After the first > > click, > > >the same screen remains in the browser. The only > > >change is what is shown in the address bar. I have > > to > > >click the LOGOFF button again and then the welcome > > >page is displayed. > > > > > >What should I do to go back to the welcome page in > > one step? > > > > > >__ > > >Do you Yahoo!? > > >Exclusive Video Premiere - Britney Spears > > >http://launch.yahoo.com/promos/britneyspears/ > > > > > > >- > > >To unsubscribe, e-mail: > > [EMAIL PROTECTED] > > >For additional commands, e-mail: > > [EMAIL PROTECTED] > > > > > > > > > > > > > -- > > Brice D. Ruth > > Sr. IT Analyst > > Fiskars Brands, Inc. > > > > > > > > > - > > To unsubscribe, e-mail: > > [EMAIL PROTECTED] > > For additional commands, e-mail: > > [EMAIL PROTECTED] > > > > __ > Do you Yahoo!? > The New Yahoo! Shopping - with improved product search > http://shopping.yahoo.com > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Forward Cannot Be Achieved In One Step
u can also use logoff where logoff is ur global forward. logoff hence it wont be a 2 step stuff but directly calling ur Action class which does cleanup work for the log off process as session cleaning up and invalidating the other objects (probably signing off the user), And forwards later on to one of the jsp's U can create a global forward for the same too which represents an action. I guess its only available in 1.1 version of Struts. -Original Message- From: Caroline Jen [mailto:[EMAIL PROTECTED] Sent: 28 October 2003 17:05 To: Struts Users Mailing List Subject: Re: Forward Cannot Be Achieved In One Step The do/Menu "does" display my welcome page. The LOGOUT button and forward "does" eventually lead the visitor to the welcome page. The problem is that it takes two steps intead of going straight to the welcome page. Let me re-state my problem: I have the following code in the navbarMenu.jsp: LOGOUT and in the struts-config.xml, I have: and In the LogoffAction.java, I invalidate the session and I want the user to go back the welcome page. And The .article.Menu is my tile that displays the welcome page. The problem is that it takes two steps for the user to go back to the welcome page - After the first click, the same screen remains in the browser. The only change is what is shown in the address bar. I have to click the LOGOFF button "again" and then the welcome page is displayed. What should I do to go back to the welcome page in one step? --- "Ruth, Brice" <[EMAIL PROTECTED]> wrote: > Is your "Menu" actionforward the welcome screen you > want to get to? And > does your Action return an ActionForward to this? > > Caroline Jen wrote: > > >Hi, I have the following code in the > navbarMenu.jsp: > > > >LOGOUT > > > >and in the struts-config.xml, I have: > > > > > name="exit" > > path="/do/Logoff"/> > > > >and > > > > > path="/Logoff" > > > type="org.NameOfOrganization.signoff.LogoffAction"> > > > name="success" > > path="/do/Menu"/> > > > > > >In the LogoffAction.java, I invalidate the session > and > >I want the user to go back the welcome page. > > > >The problem is that it takes two steps for the user > to > >go back to the welcome page - After the first > click, > >the same screen remains in the browser. The only > >change is what is shown in the address bar. I have > to > >click the LOGOFF button again and then the welcome > >page is displayed. > > > >What should I do to go back to the welcome page in > one step? > > > >__ > >Do you Yahoo!? > >Exclusive Video Premiere - Britney Spears > >http://launch.yahoo.com/promos/britneyspears/ > > > >- > >To unsubscribe, e-mail: > [EMAIL PROTECTED] > >For additional commands, e-mail: > [EMAIL PROTECTED] > > > > > > > > -- > Brice D. Ruth > Sr. IT Analyst > Fiskars Brands, Inc. > > > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Visit our website at http://www.ubs.com This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. This message is provided for informational purposes and should not be construed as a solicitation or offer to buy or sell any securities or related financial instruments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Forward Cannot Be Achieved In One Step
forward from /Logoff action need to go to welcome screen (jsp) not via another action. -Original Message- From: Caroline Jen [mailto:[EMAIL PROTECTED] Sent: 28 October 2003 17:05 To: Struts Users Mailing List Subject: Re: Forward Cannot Be Achieved In One Step The do/Menu "does" display my welcome page. The LOGOUT button and forward "does" eventually lead the visitor to the welcome page. The problem is that it takes two steps intead of going straight to the welcome page. Let me re-state my problem: I have the following code in the navbarMenu.jsp: LOGOUT and in the struts-config.xml, I have: and In the LogoffAction.java, I invalidate the session and I want the user to go back the welcome page. And The .article.Menu is my tile that displays the welcome page. The problem is that it takes two steps for the user to go back to the welcome page - After the first click, the same screen remains in the browser. The only change is what is shown in the address bar. I have to click the LOGOFF button "again" and then the welcome page is displayed. What should I do to go back to the welcome page in one step? --- "Ruth, Brice" <[EMAIL PROTECTED]> wrote: > Is your "Menu" actionforward the welcome screen you > want to get to? And > does your Action return an ActionForward to this? > > Caroline Jen wrote: > > >Hi, I have the following code in the > navbarMenu.jsp: > > > >LOGOUT > > > >and in the struts-config.xml, I have: > > > > > name="exit" > > path="/do/Logoff"/> > > > >and > > > > > path="/Logoff" > > > type="org.NameOfOrganization.signoff.LogoffAction"> > > > name="success" > > path="/do/Menu"/> > > > > > >In the LogoffAction.java, I invalidate the session > and > >I want the user to go back the welcome page. > > > >The problem is that it takes two steps for the user > to > >go back to the welcome page - After the first > click, > >the same screen remains in the browser. The only > >change is what is shown in the address bar. I have > to > >click the LOGOFF button again and then the welcome > >page is displayed. > > > >What should I do to go back to the welcome page in > one step? > > > >__ > >Do you Yahoo!? > >Exclusive Video Premiere - Britney Spears > >http://launch.yahoo.com/promos/britneyspears/ > > > >- > >To unsubscribe, e-mail: > [EMAIL PROTECTED] > >For additional commands, e-mail: > [EMAIL PROTECTED] > > > > > > > > -- > Brice D. Ruth > Sr. IT Analyst > Fiskars Brands, Inc. > > > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Visit our website at http://www.ubs.com This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. This message is provided for informational purposes and should not be construed as a solicitation or offer to buy or sell any securities or related financial instruments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Forward Cannot Be Achieved In One Step
Thanks for the reply. Now, I understand that I have two actions. However, I do quite understand what you suggested. You said: u can also use logoff where logoff is ur global forward. logoff I still have two actions if I use logoff because I have In the LogoffAction.java, I invalidate the session and I want the user to go back the welcome page. And The .article.Menu is my tile that displays the welcome page. --- [EMAIL PROTECTED] wrote: > u can also use > logoff > where logoff is ur global forward. > logoff > hence it wont be a 2 step stuff but directly calling > ur Action class which does cleanup work for the log > off process as session cleaning up and invalidating > the other objects (probably signing off the user), > And forwards later on to one of the jsp's > U can create a global forward for the same too which > represents an action. > I guess its only available in 1.1 version of Struts. > > > -Original Message- > From: Caroline Jen [mailto:[EMAIL PROTECTED] > Sent: 28 October 2003 17:05 > To: Struts Users Mailing List > Subject: Re: Forward Cannot Be Achieved In One Step > > > The do/Menu "does" display my welcome page. The > LOGOUT button and forward "does" eventually lead the > visitor to the welcome page. The problem is that it > takes two steps intead of going straight to the > welcome page. Let me re-state my problem: > > I have the following code in the navbarMenu.jsp: > > LOGOUT > > and in the struts-config.xml, I have: > > name="exit" >path="/do/Logoff"/> > > and > > path="/Logoff" > > type="org.NameOfOrganization.signoff.LogoffAction"> >name="success" > path="/do/Menu"/> > > > In the LogoffAction.java, I invalidate the session > and > I want the user to go back the welcome page. And > >path="/Menu" > name="menuForm" > > type="org.apache.struts.scaffold.ExistsAttributeAction" > parameter="application;HOURS"> > name="success" >path=".article.Menu"/> > name="failure" >path="/do/MenuCreate"/> > > The .article.Menu is my tile that displays the > welcome > page. > > The problem is that it takes two steps for the user > to > go back to the welcome page - After the first click, > the same screen remains in the browser. The only > change is what is shown in the address bar. I have > to > click the LOGOFF button "again" and then the welcome > page is displayed. > > What should I do to go back to the welcome page in > one > step? > > --- "Ruth, Brice" <[EMAIL PROTECTED]> wrote: > > Is your "Menu" actionforward the welcome screen > you > > want to get to? And > > does your Action return an ActionForward to this? > > > > Caroline Jen wrote: > > > > >Hi, I have the following code in the > > navbarMenu.jsp: > > > > > >LOGOUT > > > > > >and in the struts-config.xml, I have: > > > > > > > > name="exit" > > > path="/do/Logoff"/> > > > > > >and > > > > > > > > path="/Logoff" > > > > > > type="org.NameOfOrganization.signoff.LogoffAction"> > > > > > name="success" > > > path="/do/Menu"/> > > > > > > > > >In the LogoffAction.java, I invalidate the > session > > and > > >I want the user to go back the welcome page. > > > > > >The problem is that it takes two steps for the > user > > to > > >go back to the welcome page - After the first > > click, > > >the same screen remains in the browser. The only > > >change is what is shown in the address bar. I > have > > to > > >click the LOGOFF button again and then the > welcome > > >page is displayed. > > > > > >What should I do to go back to the welcome page > in > > one step? > > > > > >__ > > >Do you Yahoo!? > > >Exclusive Video Premiere - Britney Spears > > >http://launch.yahoo.com/promos/britneyspears/ > > > > > > >- > > >To unsubscribe, e-mail: > > [EMAIL PROTECTED] > > >For additional commands, e-mail: > &
RE: Forward Cannot Be Achieved In One Step
Let me re-phrase my question. Upon the user click on the LOGOUT buttion, I have two actions - the first one of the actions is Logoff.java in which I invalidate the session, ..., etc. and the second action upon success will lead the user to the welcome page in which choices for unregistered member plus a LOGON buttion is provided. As long as two actions are involved, the user does not get back to the welcome page by just click on the LOGOFF button "only once". Need your guidance on how such a situation is usually handled? --- Caroline Jen <[EMAIL PROTECTED]> wrote: > Thanks for the reply. Now, I understand that I have > two actions. However, I do quite understand what > you > suggested. You said: > > u can also use > logoff > where logoff is ur global forward. > logoff > > I still have two actions if I use > logoff > > because I have > > path="/Logoff" > > type="org.NameOfOrganization.signoff.LogoffAction"> > name="success" > path="/do/Menu"/> > > > In the LogoffAction.java, I invalidate the session > and I want the user to go back the welcome page. > And > >path="/Menu" > name="menuForm" > type="org.apache.struts.scaffold.ExistsAttributeAction" > parameter="application;HOURS"> > name="success" > path=".article.Menu"/> > name="failure" > path="/do/MenuCreate"/> > > The .article.Menu is my tile that displays the > welcome > page. > > > > --- [EMAIL PROTECTED] wrote: > > u can also use > > logoff > > where logoff is ur global forward. > > logoff > > hence it wont be a 2 step stuff but directly > calling > > ur Action class which does cleanup work for the > log > > off process as session cleaning up and > invalidating > > the other objects (probably signing off the user), > > And forwards later on to one of the jsp's > > U can create a global forward for the same too > which > > represents an action. > > I guess its only available in 1.1 version of > Struts. > > > > > > -Original Message- > > From: Caroline Jen [mailto:[EMAIL PROTECTED] > > Sent: 28 October 2003 17:05 > > To: Struts Users Mailing List > > Subject: Re: Forward Cannot Be Achieved In One > Step > > > > > > The do/Menu "does" display my welcome page. The > > LOGOUT button and forward "does" eventually lead > the > > visitor to the welcome page. The problem is that > it > > takes two steps intead of going straight to the > > welcome page. Let me re-state my problem: > > > > I have the following code in the navbarMenu.jsp: > > > > LOGOUT > > > > and in the struts-config.xml, I have: > > > > >name="exit" > >path="/do/Logoff"/> > > > > and > > > > >path="/Logoff" > > > > > type="org.NameOfOrganization.signoff.LogoffAction"> > > > name="success" > > path="/do/Menu"/> > > > > > > In the LogoffAction.java, I invalidate the session > > and > > I want the user to go back the welcome page. And > > > > > path="/Menu" > > name="menuForm" > > > > > type="org.apache.struts.scaffold.ExistsAttributeAction" > > parameter="application;HOURS"> > > >name="success" > >path=".article.Menu"/> > > >name="failure" > >path="/do/MenuCreate"/> > > > > The .article.Menu is my tile that displays the > > welcome > > page. > > > > The problem is that it takes two steps for the > user > > to > > go back to the welcome page - After the first > click, > > the same screen remains in the browser. The only > > change is what is shown in the address bar. I > have > > to > > click the LOGOFF button "again" and then the > welcome > > page is displayed. > > > > What should I do to go back to the welcome page in > > one > > step? > > > > --- "Ruth, Brice" <[EMAIL PROTECTED]> wrote: > > > Is your "Menu" actionforward the welcome screen > > you > > > want to get to? And > > > does your Action return an ActionForward to >
RE: Forward Cannot Be Achieved In One Step
I usually handle logoffs by having my logoff action invoke a jsp that does a With a forward setting having 'redirect="true"'. That forces the broswer to do a redirect and reload the new page, allowing the URL to read as the proper page. Warning: with Struts v1.1 or earlier, this will not work if you give it a forward listing a tile instead of a JSP or action path. Regards, David -Original Message- From: Caroline Jen [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 28, 2003 4:51 PM To: Struts Users Mailing List Subject: RE: Forward Cannot Be Achieved In One Step Let me re-phrase my question. Upon the user click on the LOGOUT buttion, I have two actions - the first one of the actions is Logoff.java in which I invalidate the session, ..., etc. and the second action upon success will lead the user to the welcome page in which choices for unregistered member plus a LOGON buttion is provided. As long as two actions are involved, the user does not get back to the welcome page by just click on the LOGOFF button "only once". Need your guidance on how such a situation is usually handled? --- Caroline Jen <[EMAIL PROTECTED]> wrote: > Thanks for the reply. Now, I understand that I have > two actions. However, I do quite understand what > you > suggested. You said: > > u can also use > logoff > where logoff is ur global forward. > logoff > > I still have two actions if I use > logoff > > because I have > > path="/Logoff" > > type="org.NameOfOrganization.signoff.LogoffAction"> > name="success" > path="/do/Menu"/> > > > In the LogoffAction.java, I invalidate the session > and I want the user to go back the welcome page. > And > >path="/Menu" > name="menuForm" > type="org.apache.struts.scaffold.ExistsAttributeAction" > parameter="application;HOURS"> > name="success" > path=".article.Menu"/> > name="failure" > path="/do/MenuCreate"/> > > The .article.Menu is my tile that displays the > welcome > page. > > > > --- [EMAIL PROTECTED] wrote: > > u can also use > > logoff > > where logoff is ur global forward. > > logoff > > hence it wont be a 2 step stuff but directly > calling > > ur Action class which does cleanup work for the > log > > off process as session cleaning up and > invalidating > > the other objects (probably signing off the user), > > And forwards later on to one of the jsp's > > U can create a global forward for the same too > which > > represents an action. > > I guess its only available in 1.1 version of > Struts. > > > > > > -Original Message- > > From: Caroline Jen [mailto:[EMAIL PROTECTED] > > Sent: 28 October 2003 17:05 > > To: Struts Users Mailing List > > Subject: Re: Forward Cannot Be Achieved In One > Step > > > > > > The do/Menu "does" display my welcome page. The > > LOGOUT button and forward "does" eventually lead > the > > visitor to the welcome page. The problem is that > it > > takes two steps intead of going straight to the > > welcome page. Let me re-state my problem: > > > > I have the following code in the navbarMenu.jsp: > > > > LOGOUT > > > > and in the struts-config.xml, I have: > > > > >name="exit" > >path="/do/Logoff"/> > > > > and > > > > >path="/Logoff" > > > > > type="org.NameOfOrganization.signoff.LogoffAction"> > > > name="success" > > path="/do/Menu"/> > > > > > > In the LogoffAction.java, I invalidate the session > > and > > I want the user to go back the welcome page. And > > > > > path="/Menu" > > name="menuForm" > > > > > type="org.apache.struts.scaffold.ExistsAttributeAction" > > parameter="application;HOURS"> > > >name="success" > >path=".article.Menu"/> > > >name="failure" > >path="/do/MenuCreate"/> > > > > The .article.Menu is my tile that displays the > > welcome > > page. > > > > The problem is that it takes two steps for the > user > > to > > go back to the welcome page - After the first > click, >
RE: Forward Cannot Be Achieved In One Step
At the end of your first action execute() method, do a redirect to the second action. Something like the following: return new ActionForward("secondAction.do"); Hope this helps! -Yan -Original Message- From: Caroline Jen [mailto:[EMAIL PROTECTED] Sent: October 28, 2003 2:51 PM To: Struts Users Mailing List Subject: RE: Forward Cannot Be Achieved In One Step Let me re-phrase my question. Upon the user click on the LOGOUT buttion, I have two actions - the first one of the actions is Logoff.java in which I invalidate the session, ..., etc. and the second action upon success will lead the user to the welcome page in which choices for unregistered member plus a LOGON buttion is provided. As long as two actions are involved, the user does not get back to the welcome page by just click on the LOGOFF button "only once". Need your guidance on how such a situation is usually handled? --- Caroline Jen <[EMAIL PROTECTED]> wrote: > Thanks for the reply. Now, I understand that I have > two actions. However, I do quite understand what > you > suggested. You said: > > u can also use > logoff > where logoff is ur global forward. > logoff > > I still have two actions if I use > logoff > > because I have > > path="/Logoff" > > type="org.NameOfOrganization.signoff.LogoffAction"> > name="success" > path="/do/Menu"/> > > > In the LogoffAction.java, I invalidate the session > and I want the user to go back the welcome page. > And > >path="/Menu" > name="menuForm" > type="org.apache.struts.scaffold.ExistsAttributeAction" > parameter="application;HOURS"> > name="success" > path=".article.Menu"/> > name="failure" > path="/do/MenuCreate"/> > > The .article.Menu is my tile that displays the > welcome > page. > > > > --- [EMAIL PROTECTED] wrote: > > u can also use > > logoff > > where logoff is ur global forward. > > logoff > > hence it wont be a 2 step stuff but directly > calling > > ur Action class which does cleanup work for the > log > > off process as session cleaning up and > invalidating > > the other objects (probably signing off the user), > > And forwards later on to one of the jsp's > > U can create a global forward for the same too > which > > represents an action. > > I guess its only available in 1.1 version of > Struts. > > > > > > -Original Message- > > From: Caroline Jen [mailto:[EMAIL PROTECTED] > > Sent: 28 October 2003 17:05 > > To: Struts Users Mailing List > > Subject: Re: Forward Cannot Be Achieved In One > Step > > > > > > The do/Menu "does" display my welcome page. The > > LOGOUT button and forward "does" eventually lead > the > > visitor to the welcome page. The problem is that > it > > takes two steps intead of going straight to the > > welcome page. Let me re-state my problem: > > > > I have the following code in the navbarMenu.jsp: > > > > LOGOUT > > > > and in the struts-config.xml, I have: > > > > >name="exit" > >path="/do/Logoff"/> > > > > and > > > > >path="/Logoff" > > > > > type="org.NameOfOrganization.signoff.LogoffAction"> > > > name="success" > > path="/do/Menu"/> > > > > > > In the LogoffAction.java, I invalidate the session > > and > > I want the user to go back the welcome page. And > > > > > path="/Menu" > > name="menuForm" > > > > > type="org.apache.struts.scaffold.ExistsAttributeAction" > > parameter="application;HOURS"> > > >name="success" > >path=".article.Menu"/> > > >name="failure" > >path="/do/MenuCreate"/> > > > > The .article.Menu is my tile that displays the > > welcome > > page. > > > > The problem is that it takes two steps for the > user > > to > > go back to the welcome page - After the first > click, > > the same screen remains in the browser. The only > > change is what is shown in the address bar. I > have > > to > > click the LOGOFF button "again" and then the > welcome > >
RE: Forward Cannot Be Achieved In One Step
I have tried your suggestion. It still takes two steps to go back to the welcome page. As long as there are two actions in between, it does not seem that I can go directly from "clicking the LOGOUT buttion" to "have the welcome page displayed". I really wish to learn what people usually do - the first one of those two actions is Logoff.java in which I invalidate the session, ..., etc. and the second action upon success will lead the user to the welcome page in which choices available for unregistered members plus a LOGON buttion are provided. -Caroline --- Yansheng Lin <[EMAIL PROTECTED]> wrote: > At the end of your first action execute() method, do > > a redirect to the second action. Something like the > following: > return new ActionForward("secondAction.do"); > > Hope this helps! > > -Yan > > -Original Message- > From: Caroline Jen [mailto:[EMAIL PROTECTED] > Sent: October 28, 2003 2:51 PM > To: Struts Users Mailing List > Subject: RE: Forward Cannot Be Achieved In One Step > > > Let me re-phrase my question. > > Upon the user click on the LOGOUT buttion, I have > two > actions - the first one of the actions is > Logoff.java > in which I invalidate the session, ..., etc. and the > second action upon success will lead the user to the > welcome page in which choices for unregistered > member > plus a LOGON buttion is provided. > > As long as two actions are involved, the user does > not > get back to the welcome page by just click on the > LOGOFF button "only once". > > Need your guidance on how such a situation is > usually > handled? > > > --- Caroline Jen <[EMAIL PROTECTED]> wrote: > > Thanks for the reply. Now, I understand that I > have > > two actions. However, I do quite understand what > > you > > suggested. You said: > > > > u can also use > > logoff > > where logoff is ur global forward. > > logoff > > > > I still have two actions if I use > > logoff > > > > because I have > > > > >path="/Logoff" > > > > > type="org.NameOfOrganization.signoff.LogoffAction"> > > > name="success" > > path="/do/Menu"/> > > > > > > In the LogoffAction.java, I invalidate the session > > and I want the user to go back the welcome page. > > And > > > > > path="/Menu" > > name="menuForm" > > > type="org.apache.struts.scaffold.ExistsAttributeAction" > > parameter="application;HOURS"> > > > name="success" > > path=".article.Menu"/> > > > name="failure" > > path="/do/MenuCreate"/> > > > > The .article.Menu is my tile that displays the > > welcome > > page. > > > > > > > > --- [EMAIL PROTECTED] wrote: > > > u can also use > > > logoff > > > where logoff is ur global forward. > > > logoff > > > hence it wont be a 2 step stuff but directly > > calling > > > ur Action class which does cleanup work for the > > log > > > off process as session cleaning up and > > invalidating > > > the other objects (probably signing off the > user), > > > And forwards later on to one of the jsp's > > > U can create a global forward for the same too > > which > > > represents an action. > > > I guess its only available in 1.1 version of > > Struts. > > > > > > > > > -Original Message- > > > From: Caroline Jen [mailto:[EMAIL PROTECTED] > > > Sent: 28 October 2003 17:05 > > > To: Struts Users Mailing List > > > Subject: Re: Forward Cannot Be Achieved In One > > Step > > > > > > > > > The do/Menu "does" display my welcome page. The > > > LOGOUT button and forward "does" eventually lead > > the > > > visitor to the welcome page. The problem is > that > > it > > > takes two steps intead of going straight to the > > > welcome page. Let me re-state my problem: > > > > > > I have the following code in the navbarMenu.jsp: > > > > > > LOGOUT > > > > > > and in the struts-config.xml, I have: > > > > > > > >name="exit" > > >path="/do/Logoff"/> > > > > > > and > > > > >
Re: Forward Cannot Be Achieved In One Step
I go directly to the welcome page this way: struts-config: In action: public final class LogoffAction extends Action { public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { // Extract attributes we will need HttpSession session = request.getSession(); String user = (String) session.getAttribute(Constants.USER_KEY); // Remove user login session.removeAttribute(Constants.USER_KEY); // Return success return (mapping.findForward(Constants.SUCCESS)); Barry - Original Message - From: "Caroline Jen" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Tuesday, October 28, 2003 6:02 PM Subject: RE: Forward Cannot Be Achieved In One Step > I have tried your suggestion. It still takes two > steps to go back to the welcome page. > > As long as there are two actions in between, it does > not seem that I can go directly from "clicking the > LOGOUT buttion" to "have the welcome page displayed". > > I really wish to learn what people usually do - the > first one of those two actions is Logoff.java in which > I invalidate the session, ..., etc. and the second > action upon success will lead the user to the welcome > page in which choices available for unregistered > members plus a LOGON buttion are provided. > > -Caroline > > --- Yansheng Lin <[EMAIL PROTECTED]> wrote: > > At the end of your first action execute() method, do > > > > a redirect to the second action. Something like the > > following: > > return new ActionForward("secondAction.do"); > > > > Hope this helps! > > > > -Yan > > > > -Original Message- > > From: Caroline Jen [mailto:[EMAIL PROTECTED] > > Sent: October 28, 2003 2:51 PM > > To: Struts Users Mailing List > > Subject: RE: Forward Cannot Be Achieved In One Step > > > > > > Let me re-phrase my question. > > > > Upon the user click on the LOGOUT buttion, I have > > two > > actions - the first one of the actions is > > Logoff.java > > in which I invalidate the session, ..., etc. and the > > second action upon success will lead the user to the > > welcome page in which choices for unregistered > > member > > plus a LOGON buttion is provided. > > > > As long as two actions are involved, the user does > > not > > get back to the welcome page by just click on the > > LOGOFF button "only once". > > > > Need your guidance on how such a situation is > > usually > > handled? > > > > > > --- Caroline Jen <[EMAIL PROTECTED]> wrote: > > > Thanks for the reply. Now, I understand that I > > have > > > two actions. However, I do quite understand what > > > you > > > suggested. You said: > > > > > > u can also use > > > logoff > > > where logoff is ur global forward. > > > logoff > > > > > > I still have two actions if I use > > > logoff > > > > > > because I have > > > > > > > >path="/Logoff" > > > > > > > > type="org.NameOfOrganization.signoff.LogoffAction"> > > > > > name="success" > > > path="/do/Menu"/> > > > > > > > > > In the LogoffAction.java, I invalidate the session > > > and I want the user to go back the welcome page. > > > And > > > > > > > > path="/Menu" > > > name="menuForm" > > > > > > type="org.apache.struts.scaffold.ExistsAttributeAction" > > > parameter="application;HOURS"> > > > > > name="success" > > > path=".article.Menu"/> > > > > > name="failure" > > > path="/do/MenuCreate"/> > > > > > > The .article.Menu is my tile that displays the > > > welcome > > > page. > > > > > > > > > > > > --- [EMAIL PROTECTED] wrote: > > > > u can also use > > > > logoff > > > > where logoff is ur global forward. > > > > logoff > > > > hence it wont be a 2 step stuff but directly > > > calling > > > > ur Action class which does cleanup work for the > > > log > > > > off
RE: Forward Cannot Be Achieved In One Step
Hi, It may be that invalidating the session is causing your next Action to fail, which is why it does not return success and hence doesn't take you to the next page. I have used forwarding to another action and it has worked for me: My struts config looks like: Check the app log files, it will tell you why its failing. Hope that helps. Mahesh -- Mahesh Joshi W- 408-543-7214 M- 408-829-8051 [EMAIL PROTECTED] >>-Original Message- >>From: Caroline Jen [mailto:[EMAIL PROTECTED] >>Sent: Tuesday, October 28, 2003 6:02 PM >>To: Struts Users Mailing List >>Subject: RE: Forward Cannot Be Achieved In One Step >> >> >>I have tried your suggestion. It still takes two >>steps to go back to the welcome page. >> >>As long as there are two actions in between, it does >>not seem that I can go directly from "clicking the >>LOGOUT buttion" to "have the welcome page displayed". >> >>I really wish to learn what people usually do - the >>first one of those two actions is Logoff.java in which >>I invalidate the session, ..., etc. and the second >>action upon success will lead the user to the welcome >>page in which choices available for unregistered >>members plus a LOGON buttion are provided. >> >>-Caroline >> >>--- Yansheng Lin <[EMAIL PROTECTED]> wrote: >>> At the end of your first action execute() method, do >>> >>> a redirect to the second action. Something like the >>> following: >>> return new ActionForward("secondAction.do"); >>> >>> Hope this helps! >>> >>> -Yan >>> >>> -Original Message- >>> From: Caroline Jen [mailto:[EMAIL PROTECTED] >>> Sent: October 28, 2003 2:51 PM >>> To: Struts Users Mailing List >>> Subject: RE: Forward Cannot Be Achieved In One Step >>> >>> >>> Let me re-phrase my question. >>> >>> Upon the user click on the LOGOUT buttion, I have >>> two >>> actions - the first one of the actions is >>> Logoff.java >>> in which I invalidate the session, ..., etc. and the >>> second action upon success will lead the user to the >>> welcome page in which choices for unregistered >>> member >>> plus a LOGON buttion is provided. >>> >>> As long as two actions are involved, the user does >>> not >>> get back to the welcome page by just click on the >>> LOGOFF button "only once". >>> >>> Need your guidance on how such a situation is >>> usually >>> handled? >>> >>> >>> --- Caroline Jen <[EMAIL PROTECTED]> wrote: >>> > Thanks for the reply. Now, I understand that I >>> have >>> > two actions. However, I do quite understand what >>> > you >>> > suggested. You said: >>> > >>> > u can also use >>> > logoff >>> > where logoff is ur global forward. >>> > logoff >>> > >>> > I still have two actions if I use >>> > logoff >>> > >>> > because I have >>> > >>> > >> >path="/Logoff" >>> > >>> > >>> type="org.NameOfOrganization.signoff.LogoffAction"> >>> > >> > name="success" >>> > path="/do/Menu"/> >>> > >>> > >>> > In the LogoffAction.java, I invalidate the session >>> > and I want the user to go back the welcome page. >>> > And >>> > >>> > >> > path="/Menu" >>> > name="menuForm" >>> > >>> >>type="org.apache.struts.scaffold.ExistsAttributeAction" >>> > parameter="application;HOURS"> >>> > >> > name="success" >>> > path=".article.Menu"/> >>> > >> > name="failure" >>> > path="/do/MenuCreate"/> >>> > >>> > The .article.Menu is my tile that displays the >>> > welcome >>> > page. >>> > >>> > >>> > >>> > --- [EMAIL PROTECTED] wrote: >>> > > u can also use >>> > > logoff >>> > > where logoff is ur global forward. >>>
Re: Forward Cannot Be Achieved In One Step
Excellent! It is the way to do it. Thank you for your guidance. It is very dumb of me not to think of it. --- Barry Volpe <[EMAIL PROTECTED]> wrote: > I go directly to the welcome page this way: > > > struts-config: > > type="com.childrencare.LogoffAction"> > name="success" > path="/index.jsp"/> > > > In action: > public final class LogoffAction extends Action { > > public ActionForward execute(ActionMapping mapping, > > ActionForm form, > > HttpServletRequest request, > > HttpServletResponse response) > > throws IOException, ServletException { > > // Extract attributes we will need > > HttpSession session = request.getSession(); > > > > String user = (String) > > session.getAttribute(Constants.USER_KEY); > > // Remove user login > > session.removeAttribute(Constants.USER_KEY); > > // Return success > > return (mapping.findForward(Constants.SUCCESS)); > > Barry > > > > > > > > > > ----- Original Message ----- > From: "Caroline Jen" <[EMAIL PROTECTED]> > To: "Struts Users Mailing List" > <[EMAIL PROTECTED]> > Sent: Tuesday, October 28, 2003 6:02 PM > Subject: RE: Forward Cannot Be Achieved In One Step > > > > I have tried your suggestion. It still takes two > > steps to go back to the welcome page. > > > > As long as there are two actions in between, it > does > > not seem that I can go directly from "clicking the > > LOGOUT buttion" to "have the welcome page > displayed". > > > > I really wish to learn what people usually do - > the > > first one of those two actions is Logoff.java in > which > > I invalidate the session, ..., etc. and the second > > action upon success will lead the user to the > welcome > > page in which choices available for unregistered > > members plus a LOGON buttion are provided. > > > > -Caroline > > > > --- Yansheng Lin <[EMAIL PROTECTED]> wrote: > > > At the end of your first action execute() > method, do > > > > > > a redirect to the second action. Something like > the > > > following: > > > return new ActionForward("secondAction.do"); > > > > > > Hope this helps! > > > > > > -Yan > > > > > > -Original Message- > > > From: Caroline Jen [mailto:[EMAIL PROTECTED] > > > > Sent: October 28, 2003 2:51 PM > > > To: Struts Users Mailing List > > > Subject: RE: Forward Cannot Be Achieved In One > Step > > > > > > > > > Let me re-phrase my question. > > > > > > Upon the user click on the LOGOUT buttion, I > have > > > two > > > actions - the first one of the actions is > > > Logoff.java > > > in which I invalidate the session, ..., etc. and > the > > > second action upon success will lead the user to > the > > > welcome page in which choices for unregistered > > > member > > > plus a LOGON buttion is provided. > > > > > > As long as two actions are involved, the user > does > > > not > > > get back to the welcome page by just click on > the > > > LOGOFF button "only once". > > > > > > Need your guidance on how such a situation is > > > usually > > > handled? > > > > > > > > > --- Caroline Jen <[EMAIL PROTECTED]> wrote: > > > > Thanks for the reply. Now, I understand that > I > > > have > > > > two actions. However, I do quite understand > what > > > > you > > > > suggested. You said: > > > > > > > > u can also use > > > > logoff > > > > where logoff is ur global forward. > > > > forward="/Logoff">logoff > > > > > > > > I still have two actions if I use > > > > action="/do/Logoff">logoff > > > > > > > > because I have > > > > > > > > > > >path="/Logoff" > > > > > > > > > > > > type="org.NameOfOrganization.signoff.LogoffAction"> > > > > > > > name="success" > > > > path="/do/Menu"/> > > > > > > > > > > > > In the LogoffAction.java, I invalidate the > session > > > > and I want the user to go back the welcome > page. > > > > And > > > > > > > > > > > path="/Menu" > > > > name="menuForm" > > > > > > > > > > type="org.apache.struts.scaffold.ExistsAttributeAction" > > > > parameter="application;HOURS"> > > > > > > > name="success" > > > > path=".article.Menu"/> > > > > > > > name="failure" > > > > path="/do/MenuCreate"/> > > > > > > > > The .article.Menu is my tile that displays the > > > > welcome > > > > page. > > > > > > > > > > > > > > > > --- [EMAIL PROTECTED] wrote: > > > > > u can also use > > > > > action="/Logoff">logoff > > > > > where logoff is ur global forward. > > > > > forward="/Logoff">logoff > > > > > hence it wont be a 2 step stuff but directly > > > > calling > > > > > ur Action class which does cleanup work for > the > === message truncated === __ Do you Yahoo!? Exclusive Video Premiere - Britney Spears http://launch.yahoo.com/promos/britneyspears/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]