• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to store the page context and where would it be better.

 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In my site there would be a link to the third party site. After login to my site, the user clicks the
third party link on my site. The user will be directed to that site by opening new browser window. If
the user navigate the third party site (say he browsed page no.3), then the information has to be stored
some where so that, if he comes to my site on next day and if he clicks the third party link on my site,
it has to take him directly to the Page 3 of third party site (as he browsed up to this page on previous
session).
Both sites are secured and implemented with Java technologies and user state is maintained with HttpSession.

What would be the better approach to store this information. Would it be better to store in my site
or third party site. If so, how? I don�t have any restrictions to play with the third party site to
make changes. I can�t store this information in session as they may expire and both sites are running
in different servers.
 
Ranch Hand
Posts: 527
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think Session is the only solution to ur requirement since it can be carried over muliple servers.
 
author
Posts: 3252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In the interest of reducing the coupling between the sites, your site should preferably not keep any information about state on the third party site.
Using sessions is out of the question, as your typical session won't be around the next day You will have to persist this information, either in a database or in a cookie.
One way of implementing this is to have the third party site maintain a per-user, persistent state indicating the last location visited. This is most easily done using a page include or even better a filter servlet (or better still a Servlet 2.3 filter). Once you have that, create a special location which reads the state and redirects the user there (say, http://www.3rdpartysite.com/LastLocation; if you use a database, this would be a servlet; if you use cookies, it could even be plain HTML with a bit of JavaScript). If there is no last known location, it would redirect to the main index page.
Then all you'd have to do in your site is link to http://www.3rdpartysite.com/LastLocation.
This keeps the coupling very loose - the only coupling is the existence of this special location which is supposed to take the user to the last visited location.
- Peter

[This message has been edited by Peter den Haan (edited April 24, 2001).]
 
Alex Iordache
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot for spending your precious time. Do you have any high level description regarding how to use Servlet 2.3 filter for my problem. Right now I am using page include and each and every page has to call database to update the user lastlocation.
reply
    Bookmark Topic Watch Topic
  • New Topic