0

I have a class hold value of a user in session

 @SessionScoped
 class UserSession{}

Now I have a LoginFilter to ensure some url accessed with user login

class LoginFilter{
   @Inject UserSession userSession;
   ...
}

Then Out of scope exception was thrown when I try to bootstrap jetty. How can I check if the session contains the UserSession object? I don't know the attribute name of UserSession class.

Ingo
  • 1,552
  • 10
  • 31
jilen
  • 5,633
  • 3
  • 35
  • 84

1 Answers1

2

You can inject a Provider<UserSession> instead of a plain UserSession.

Tavian Barnes
  • 12,477
  • 4
  • 45
  • 118