• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Infinite loop using LookupDispatchAction

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a JSP page that allows the user to modify some data and then save it. After the data is saved I want to refresh the page. The problem that I'm having is that when the page is refreshed after the save, it fires the SAVE method again (and on into an infinite loop).

The action behind my page is a LookupDispatchAction with a mapped SAVE method and an UNSPECIFIED method to catch all unmapped actions. When the page is displayed for the first time I enter through the UNSPECIFIED method and retrieve data from the DB to display to the user. When the user selects the save button the code executes the mapped SAVE method and then attempts to refresh the page by forwarding the user back to the same page. I thought that I would re-enter the page through the UNSPECIFIED method (as I did the fist time the page was displayed) but I end up back in the SAVE again (and again, and again....). I need a way to refresh this page without coming back into the save method.

Any ideas? Is there something that needs to be cleared out after the first SAVE method has completed?

Thanks for the help.
 
Ben Hagadorn
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I got it. I needed to add redirect="true" to my struts.config file
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic