Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

calling bean from a servlet

 
Nidhi Singhal
Ranch Hand
Posts: 89
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
i have servlets and some bean classes containing business logic. i want to know how to call beans from a servlet.
thanks..
Nidhi
 
Sandeep Deshmukh
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi nidhi

To use a bean include that bean package in your classes directory, import that package into servlet and you can use the bean classes as you do in jsp.

Sandeep
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is the same as you use beans in your simple normal java class.
 
Nidhi Singhal
Ranch Hand
Posts: 89
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic