This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: accessing httpsession\httpsession attributes in custom validator
 
Similar Threads
How do I validate if an input box contains alphanumeric characters?
How to pass parameters or atributtes to a custom validator
Custom validator error
Custom Tag / Custom Validation Not Firing - Facelets
Range validation for dual alpha chars