jQuery in Action, 2nd edition*
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

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "problem in ValidatorSupport" Watch "problem in ValidatorSupport" New topic

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

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
I agree. Here's the link: http://aspose.com/file-tools
subject: problem in ValidatorSupport
Similar Threads
[struts 2] getting null on getSession
Logout is not properly working in struts2 please help me
problems with custom converters and move from Struts 2.0.11 to 2.1.6
Struts 2 + Spring 3 +Hibernate 3.5 Integration Problem session factory nullpointer exception
Struts 2 + Hibernate JUnit test