aspose file tools*
The moose likes Servlets and the fly likes How to instantiate Bean in servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to instantiate Bean in servlet" Watch "How to instantiate Bean in servlet" New topic
Author

How to instantiate Bean in servlet

Danish Shaukat
Ranch Hand

Joined: Nov 16, 1999
Posts: 340
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

Joined: Mar 22, 2000
Posts: 12825
    
    5
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
 
 
subject: How to instantiate Bean in servlet