See inline comments... > > Dear Servlet-Interest users, > I am having problems with session management. > What I am doing is as follows: > In one class I have: > HttpSession mysession = request.getSession(); > System.out.println("I am adding."); > mysession.setAttribute(PROTOCOL, prt); > mysession.setAttribute(ACCOUNT, prt);
I assume PROTOCOL and ACCOUNT should be "PROTOCOL" and "ACCOUNT"? If not, what are the values? > response.sendRedirect(authenticatedURI); > The response.sendRedirect sends it to another page. I have another classwhereI try >to retrieve > the Protocol object using: > HttpSession mysession = request.getSession(); > prt = (Protocol) mysession.getAttribute("PROTOCOL"); Maybe you can try the following: Enumeration e = mysession.getAttributeNames(); while (e.hasMoreElements()) out.println(e.nextElement()); That way you can at least see what attributes are attached to your session. > System.out.println(prt); > The output of the println statement is "null". > My browser version is Internet Explorer 6.0 and I have enabled the cookies. > Is there something thatI am doing wrong? > Furthermore, can someone point me to a sample example where they use URL Rewriting? >I could > try to incorporate that and see if it works! > Thanks for all the help in advance! > Sincerely, > --Andy. One more thing.. you also need to implement the Serializable interface for any object you want to attach to a HttpSession. I assume this Protocol class is being written by you, so you should make sure it implements Serializable. The logic behind it is simple, you can only send plain text in a webpage and an object by default is binary. Hope this helps. Frans ___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html