File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

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