he meant: use: HttpSession session = request.getSession( ); session.setAttribute( "itemnumber", Integer.valueOf(Integer.toString(itemnumber)));
and then: session.getAttribute( "itemnumber" ); --- Fabio Moraes [EMAIL PROTECTED] System Engineer Work Force Management System +55 21 3088 9548 -----Original Message----- From: Tim Funk [mailto:[EMAIL PROTECTED] Sent: Monday, July 28, 2003 07:53 To: Tomcat Users List Subject: Re: Strange request.setAttribute() problem This is the correct behavior. In this scenario, you are operating on the request, not the session. request.getParameter --> Get stuff from the query string (or input stream if post) - a per request thing request.setAttribute --> Set an attribute in the life of this particular request -Tim Charles So wrote: > Hello, I come across a problem with TC4.1.24 and hope fellow list users > can help me... > > > > I set a variable in a servlet by calling: > > request.setAttribute("itemnumber", > Integer.valueOf(Integer.toString(itemnumber))); > > > > A JSP will then detect if this variable exists or not by: > > if ( request.getParameter("itemnumber") != null ) { > try { > itemnumber = > Integer.parseInt((String)request.getParameter("itemnumber")); > } catch (NumberFormatException ex) { > System.out.println("No"); > } > } > > > > > I have two different web browsers opened (say, one IE and one Opera), > and both eventually will come to the page containing the code above. > > The strange thing is that if the variable "itemnumber" is set via IE, > the same "itemnumber" will be seen at Opera!!!!! > > This shouldn't happen as both have different session ID, and are > completely unrelated. > > > > Who has come across this problem? How can I work around this? > > Thanks! > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
