This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • 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: 13074
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