I'm trying to redirect to the page (which needed user authentication) after login. The first page needs user authentication and I have this annotation:
@AuthenticationPolicy(AuthenticationPolicyType.AUTHENTICATED_USERS)
This redirects me to the LoginPage, and after that, to the Index:
Object onSuccess() {
userSession = new UserSession();
....
....
return Index.class;
}
I want to redirect to the page where i wanted to go and being logged. What can I do?