• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to instantiate Bean in servlet

 
Danish Shaukat
Ranch Hand
Posts: 341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
I'm doing a web application using jsp's. How do i instantiate a bean in a servlet (controller).
Regards
Danish Shaukat
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13055
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just like creating any other object.
MyBean b = new MyBean();
AFAIK the servlet api does not provide any shortcut initialization like the JSP <jsp:setProperty ....>
(but that is rather inefficient anyway)
Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic