dcsimg
JSP & Java Bean Question - Life time of java bean or deleting it from the session or something!! HELP!
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Alfred_Wong
Posted On:   Wednesday, November 13, 2002 07:38 AM

Hello, let me give you a background what my application does. It has a form page where it takes in user input and passes it to a servlet where it parses the input and calls my database object to retrieve the information from db2. It then passes the info to a jsp page. At that point, I create a bean because cewolf requires a dataproducer object. The whole program works, but the problem is if I start up a new web browser and request different data it alwawys gives me the very first request I did, i.e. it will always graphs the first set of input got back from db2 and not the new one I just requested. Now I've been reading a couple of articles and it seems that java beans get reused in the sense that if the bean already exists it just   More>>

Hello,
let me give you a background what my application does. It has a form page where it takes in user input and passes it to a servlet where it parses the input and calls my database object to retrieve the information from db2. It then passes the info to a jsp page. At that point, I create a bean because cewolf requires a dataproducer object.

The whole program works, but the problem is if I start up a new web browser and request different data it alwawys gives me the very first request I did, i.e. it will always graphs the first set of input got back from db2 and not the new one I just requested.

Now I've been reading a couple of articles and it seems that java beans get reused in the sense that if the bean already exists it just reuses it. So I wondering if there is a way to remove that bean or anything.

Thanks


Please use html tags to format code blocks.

   <<Less

Re: JSP & Java Bean Question - Life time of java bean or deleting it from the session or something!! HELP!

Posted By:   AlessandroA_Garbagnati  
Posted On:   Thursday, November 14, 2002 12:31 AM

Alfred,

well, a bean inside a page is reused only if you store it in the same session space (HttpSession) or inside the application object (ServletContext).

If you put it inside the request or page space, then it will not be accessible from outside the same request or page context.
About | Sitemap | Contact