struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lukasz Lenart <lukaszlen...@apache.org>
Subject Re: Validation with DefaultActionValidatorManager throws NullPointerExeption
Date Wed, 26 Feb 2014 16:04:28 GMT
2014-02-26 16:59 GMT+01:00 Thomas Hermann <thermann@mtg.de>:
> Do you simply mean:
>
> -------------------------------------------------
> DefaultActionValidatorManager validator = new
> DefaultActionValidatorManager();
> validator.setFileManagerFactory(new DefaultFileManagerFactory());
> validator.validate(request, null);
> --------------------------------------------------
> ?
>
> The DefaultFileManagerFactory is not instantiated properly. I get the
> following exception now:
>
> ---------------------------------------------------
> java.lang.NullPointerException
>     at
> com.opensymphony.xwork2.util.fs.DefaultFileManagerFactory.lookupFileManager(DefaultFileManagerFactory.java:57)
>     at
> com.opensymphony.xwork2.util.fs.DefaultFileManagerFactory.getFileManager(DefaultFileManagerFactory.java:41)
>     at
> com.opensymphony.xwork2.validator.DefaultActionValidatorManager.setFileManagerFactory(DefaultActionValidatorManager.java:73)
> ---------------------------------------------------

The last thing left: new DefaultFileManager()

> Isn't there an easy way to initialize the DefaultActionValidatorManager
> properly?

It is, use dependency injection :-) Can you describe why do you want
to create DefaultActionValidatorManager manually instead using DI?


Regards
-- 
Ɓukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message