Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • 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
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Need Help and Suggestion

 
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

In the web application I am working on, each UI has a Cancel button clicking on which should navigate back to the previous page. I cannot use window.history.back() because it does not work when I refresh same page on some action. Example delete on listing.

So, I thought of holding the navigation path in the form of arraylist to the user session so that I will know the complete path from home page to any page.

I have written a two methods that take request and URL to add/remove URL to/from the session. I want all my Action classes to use these methods. I am not sure where I have to place these methods?.in Servlet/Action/POJO?

If Servlet/Action, how can I get the servlet/action object to access these methods?

If POJO will there be any synchronization problem between users?

Ur suggestion will be a great help to me.

Thank you
 
s penumudi
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have solution to my problem.
I am extending Dispatch Action class and implementing these methods in my base dispatch action class so that these methods are available in all my Action class.

Let me know if u have better solution than this.

Seems like these days I am not getting good anwsers from Javaranch.
 
author & internet detective
Posts: 41263
849
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Another way to do it is to write a filter. You declare the filter to be executed on all pages by putting it in your web.xml.

This is actually a non-struts specific way, but it feels cleaner. A filter is designed to do one thing and then pass along the request.
 
Grow a forest with seedballs and this tiny ad:
The trailboss has a kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic