Skip to content
Advertisement

Tag: superclass

Why do I have to set AuthenticationManager twice

In my application I’ve implemented X.509 authentication I created the following class named X509AuthenticationFilter that extends AbstractPreAuthenticatedProcessingFilter provided by spring security by default. I added my own AuthenticationManager to the class And also included the following setter The bean is initialized in the spring-security.xml like so: The bean named authenticationManager does exist and it’s present in the spring context. However,

Java: how to have an array of subclass types?

Say I have a super class “Animal” and subclasses “Cat”, Dog, Bird”. Is there a way to have an array of subclass type rather than class instances with which I’ll be able to instantiate instances of each possible subclass? To simplify, I want this: How can I do that? Edit: I don’t want an array of instances of these subclasses,

Advertisement