Sebastian Salvo

Greenhorn
+ Follow
since Nov 14, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Sebastian Salvo

Hi Ed,

I have the same problem and I can't find the way to retrieve any additional information from the exception.

Did you have any luck with this?

Thanks,
15 years ago
Hi all,

The Security Providers are configured in a Weblogic 7.
Does anyone knows if there is a way to return a value from the login module back to the application when the authentication process fails and a FailedLoginException is thrown?

I have my web.xml configured this way:

<login-config>
<auth-method>FORM</auth-method>
<form-login-config>
<form-login-page>/login.jsp</form-login-page>
<form-error-page>/errorPage.jsp</form-error-page>
</form-login-config>
</login-config>

Any time the login attempt fails, you get redirected to the errorPage.jsp. But what I want is to get some additional info from the security provider, e.g., an error code to display a different message according to the type of error.

Any help will be appreciated,
Thanks!
15 years ago
Thanks all for your replies.
What also sounded strange to me was instantianting an object in the static init block of the same class.

class Foo{
static{ new Foo(); }
}

Well, now I know that this is possible.
I'm studying for the SCJP exam and today I�ve faced myself to this simple piece of code that cause me to doubt.
Isn�t it breaking the final modifier semantic?

public class Foo {

final static int d;
final int e;

static {
System.out.println("starting static init block");
System.out.println("Instantiating f1.");
Foo f1 = new Foo();
d = 15;
System.out.println("Instantiating f2.");
Foo f2 = new Foo();
System.out.println("ending static init block");

}
public Foo() {
System.out.println("starting no-arg constructor");
e = d;
System.out.println(" e = " + e);
System.out.println(" d = " + d);
System.out.println("ending non-arg constructor");
}
public static void main(String[] args) {
System.out.println("calling the main method");
}

}

I mean, you have an final static member d, then when the class is first loaded the static init block runs and before assigning a value to d you create an instance of Foo, and in the Foo constructor you use d. If you execute this program the output is:

java Foo

starting static init block
Instantiating f1.
starting no-arg constructor
e = 0
d = 0
ending non-arg constructor
Instantiating f2.
starting no-arg constructor
e = 15
d = 15
ending non-arg constructor
ending static init block
calling the main method

For two different instances of Foo you get different values for the final static member d. How does it work exactly?

Thanks.