save global data in servlets
sorry about this question but:
How can I save global data in a servlet?
For example, I have a bean(userBean) stored in session that contains the user's information. A servlet receive some parameters in HttpRequest object and read others (for example user id) from Bean and I need that the methods that forms servlets read the data from the session
oSession = request.getSession(true);
oUser = (UserBean)oSesion.getAttribute("oUser");
I have to do this in each method to read the bean?????
Is there any way to avoid this?