aspose file tools*
The moose likes Struts and the fly likes problem in ValidatorSupport Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "problem in ValidatorSupport" Watch "problem in ValidatorSupport" New topic
Author

problem in ValidatorSupport

garima jain
Ranch Hand

Joined: Sep 22, 2008
Posts: 60
I am writing a small application for Online Test using struts 2.0. I wrote a custom validator class to do validation on the login screen. Following is the code for that:

If I run my application, it gives NPE on sessionMap at line no 13 . That means, struts is not initializing sessionMap variable using its setSession method. Could you please explain the reason for such behaviour.



David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Validators aren't actions--implementing SessionAware means nothing to a validator. SessionAware is for actions.
garima jain
Ranch Hand

Joined: Sep 22, 2008
Posts: 60
thanks David
 
 
subject: problem in ValidatorSupport