Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Struts and the fly likes accessing httpsession\httpsession attributes in custom validator Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "accessing httpsession\httpsession attributes in custom validator" Watch "accessing httpsession\httpsession attributes in custom validator" New topic
Author

accessing httpsession\httpsession attributes in custom validator

John Eric Hamacher
Ranch Hand

Joined: Apr 25, 2007
Posts: 230
Hello:

Is it possible to access HttpSession attributes within a Struts 2 custom validator? Thanks.
John Eric Hamacher
Ranch Hand

Joined: Apr 25, 2007
Posts: 230
I realize one way is to call ActionContext.getContext().getSession(). Is there another way?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Why would you want to? The point is to abstract away the servlet spec.
John Eric Hamacher
Ranch Hand

Joined: Apr 25, 2007
Posts: 230
Its the way things are around here. I'm not in total control.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: accessing httpsession\httpsession attributes in custom validator