I have used interceptors to check if the user is valid & if so send him to the action otherwise deny him from doing the action.I have added it into the default-stack so that it can occur on every action the user is invoking.
Its working fine & I am getting the desired results, the only issue is that now I want to show the username on the header of every page. So is there a way I can send some variable like username from the interceptor to every action I am invoking or directly to the jsp?
I have used interceptors to check if the user is valid & if so
Share
You need to persist it in a way each request can access the authenticated object. The way is to store the user object in session or at least store an identifier like username with which you could retrieve the user object again.