I have a Session-Scope Bean LoginPlaintext
that must not be serializable.
I have a Session-Scope Bean LoginMD5Salted
that must be serializable.
Both share the interface Login
that is not Serializable (because LoginPlaintext must be not serializable)!
My AppConfig.java looks like this:
public class AppConfig
...
Login loginData(ServletRequest request){
if(request.getParameter('useMD5')!=null){
return new LoginMD5Salted();
}
return new LoginPlaintext();
}
}
My PermissionBean .java looks like this:
public class PermissionBean implements Serializable{
@Autowired
Login loginData;
}
My LoginPlaintext looks like this:
public class LoginPlaintext implements Login{
String plainTextPassword;
....
}
My LoginMD5Salted looks like this:
public class LoginMD5Salted implements Login, Serializable{
private static final long serialVersionUID = 2742674005972067910L;
// not sure Upcase/Lowcase
String MD5PasswordSalted;
}
If the session is serialized: the bean LoginPlaintext
will not be persisted. If the Session is deserialized, all the other values are deserialized well but the deserializer for LoginPlaintext
throws a NotSerializableException, ok.
If the session is serialized: the bean LoginMD5Salted
will be persisted well. If the Session is deserialized, all values are deserialized well even the LoginMD5Salted
without any trouble.
Questions:
- How can i prevent a Log-Message for the class
LoginPlaintext
only? - If the LoginPlaintext could not be deserialized via reactivation, is the AppConfig's loginData() method is invoked again?