• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Forward Cannot Be Achieved In One Step

 
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I have the following code in the navbarMenu.jsp:

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.
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?
[ October 27, 2003: Message edited by: JiaPei Jen ]
[ October 28, 2003: Message edited by: JiaPei Jen ]
 
JiaPei Jen
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let me re-phrase my question. Upon the user click on the LOGOUT buttion, I have two actions - one action is Logoff.java in which I invalidate the session, ..., etc. and the other action will lead the user to the welcome page in which 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". How is such a situation usually handled?
I have the following code in the navbarMenu.jsp:

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. Therefore, in the struts-config.xml:

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.
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I dont understand why you forward the successfull logoff action to another action (menu). Why dont u just forward the logoff action to the welcome page?. You can do whatever necessary (invalidate action ect) in the log off action and after that go to the welcome page directly..
rgds
beN
 
JiaPei Jen
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

The action that /do/Menu calls does display the welcome page. The welcome page provides a number of choices available for non-registered visitors of the web site plus a LOGON button. See below, ".article.Menu" is my tile, which is my welcome page.

<action
path="/Menu"
name="menuForm"
type="org.apache.struts.scaffold.ExistsAttributeAction"
parameter="application;HOURS">
<forward
name="success"
path=".article.Menu"/>
<forward
name="failure"
path="/do/MenuCreate"/>
</action>
 
JiaPei Jen
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, I have found the solution.
 
You're not going crazy. You're going sane in a crazy word. Find comfort in this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic