• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Beans with JSP and Servlets

 
Peter Murasky Jr
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have created a package which holds some beans I created I currently use the beans on jsp pages but I need to access the beans from a servlet also. Can you please show me the code to access beans from a servlet.
Thanks,
Peter
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13077
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You create instances of Bean classes just like any other class in a servlet. There are no fancy shortcuts for setting and getting properties. Store the instance in the request for "request" scope, the session for "session" scope or the ServletContext for "application" scope.
Bill

------------------
author of:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic