0
I have a CDI Session Bean which I store some information for use in the application while the user is logged in, however I need a control that when the other Beans try to use some attribute of this Bean it is Null that the user is redirected to the information selection page.
Made the implementation in the get of the tribute in question and valid if the current page is the page of the selection if it is open the page if it does not redirect. This solution works for some screens for others has error 500 and I know it is not the ideal way to treat this problem.
Any suggestions on how I can do it?
I’ll check and test.
– Jeremias Santos
I think I’m doing something wrong, but it didn’t work. I implemented as the example document but kept asking to launch Exception and not be able to make it work.
– Jeremias Santos
In this example spoke the class Blaexception, when I insert it in the get of the attribute it asks to make a Try or cast the exception and does not work.
– Jeremias Santos
Exact. Or you create the function
public String getBla() throws BlaException {
or you cause aRuntimeException
, thus:throw new RuntimeException(new BlaException());
.– Victor T.