Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

accessing session attribute in jsp using struts2

 
Nikes Shah
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends,

I am struggling with setting session attribute in struts2 Action class.

when I set attribute in session Map in struts2, it gives NullPointer exception.

I have referred roseindia tutorial but did not succeed in setting and retrieving session attributes.

Thanks for any help.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Without knowing what you've already tried it's more difficult to help.

Normally you'd simply implement SessionAware and set the value to the session map.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic