• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

How to access a bean in a servlet file?

Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use <jsp:useBean.... create a bean in a jsp file and set its scope to "session",when the file redirect to a servlet file,i don't know how use the instance of bean in the servlet?
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that <jsp:useBean> action with a scope equals to "session" will put the object in the pageContext associated with the jsp page using a session scope. Therefore, this object is unavailable in the session object that you get with req.getSession() under a servlet.
Let's say you have defined an HttpSessionAttributeListener for the context, setting/unsetting session attributes in this context using jsp:setProperty will not fire any events either.
Rather ackward ain't it ?
Any comments ?
What I don't understand is how they changed the earth's orbit to fit the metric calendar. Tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic