Session data in servlets
We are trying to include our user name variable in our chat program as the nickname session variable that was registered when they logged in.
We have included the HttpSession session = req.getSession(true); in the servlet.
In our code we are trying to assign the variable userName as 'session.getAttribute("name")' that was registered when they logged in.
The problem we have is the the session variable seems to be an object and we need to convert it into a string. How can we do this.
Basically what we want it (pseudo code):
String username = session.getAttribute("name");
I know this session variable exists as i have used it in previous JSP pages.
Many thanks
Sambo

