Have a look at the code that is being generated by when you have put in:

            application = getServletConfig().getServletContext();
            config = getServletConfig();
            session = request.getSession(true);
            out = new JspWriter(response.getWriter(), 8192);
            response.setContentType("text/html");

            out.write("");
           // THIS SECTION CREATES YOUR BEAN
            bean.Bean bean = (bean.Bean) session.getValue("bean");
            boolean _specialbean  = false;
            if ( bean == null ) {
                _specialbean = true;
               // THIS SECTION DETECTS THAT IT DOESN'T EXIST AND CREATES IT
                try {
                    bean = (bean.Bean) Beans.instantiate(null, "bean.Bean");
                }catch (Exception exc) {
                     throw new ServletException (" Cannot create bean of class
"+"bean.Bean");
                }
                // THIS THEN PUTS IT INTO THE SESSION OBJECT AS YOU HAVE
SPECIFIED A
               // "SESSION" SCOPE
                session.putValue("bean", bean);
            }
            if(_specialbean == true) {
            }
            out.write("\r\n...\r\n<body>\r\n");

            // THIS IS WHERE YOU PUT IT INTO THE SESSION OBJECT A SECOND TIME
            session.putValue(session.getId(),bean);

Remember, each session is unique to each user.

Tommy Berglund wrote:

> value was before. What am I doing wrong??? How can each user get their
> own instantiation of the bean???

Get rid of your code adding the bean to the session and getting it out again.
That is exactly what useBean is for.

--
Richard Vowles, Senior Systems Engineer,
Brocker Professional Services, New Zealand Inprise Distributor
MAIL: [EMAIL PROTECTED], [EMAIL PROTECTED]
HTTP: http://www.esperanto.org.nz
[my messages contain my own opinions, not those of my employer]

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JSP-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to