my dog learned polymorphism*
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
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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: accessing httpsession\httpsession attributes in custom validator