• 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

session in Strut2

 
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the best of way of defining the session in strut2.

I define the session in my application as .

Map session = ActionContext.getContext().getSession();

session.put("loginDetails", user);

Is any other best way to define the session in strut2.

Thanks.
 
Ranch Hand
Posts: 494
Eclipse IDE Postgres Database Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi..
I think that's the only one way to use Session in Struts2..
Because i've used it too..

Correct me if i'm wrong..
Thanks in advance..
 
pankaj semwal
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Actually i am facing a problem.When more than one user login in the application .Some time its show the data of other user to other user.

Please tell me where i am wrong.

Thanks
 
Sheriff
Posts: 9671
42
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use SessionAware interface for setting session in your action class. Example...
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Implementing SessionAware is the best way to get access to the session, and makes testing easier.

If you're getting session "crosstalk" then it's nearly certain you're doing something wrong; without code (and possibly configs) it's impossible to help.
 
pankaj semwal
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
When the user login .
I set the session as

Map session = ActionContext.getContext().getSession();

session.put("loginDetails", user);

And in other action i am getting the user information as



Can any body tell me where i am wrong.

 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That code is fine.

What makes you think you're getting session crosstalk? How are you confirming you're having a problem?
 
pankaj semwal
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Actually this kind of problem coming from specific location.

And i found that they using proxy server.

Is there any code that the data should be pick from server not from proxy server cache.


Thanks

 
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