File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Communication between a servlet and a bean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Communication between a servlet and a bean" Watch "Communication between a servlet and a bean" New topic
Author

Communication between a servlet and a bean

saahil sinha
Ranch Hand

Joined: Apr 07, 2003
Posts: 68
Hi,
I would like to know how can a servlet communicate with a bean.Is there any way to do this if yes how?Please help me out require it to be done urgently.
Peter den Haan
author
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
If I correctly guess what your question is, the answer is request.getSession().getAttribute("beanName").
- Peter
heiner weilandt
Ranch Hand

Joined: Sep 10, 2002
Posts: 46
hi,
i believe you want to do this:
HttpSession session = request.getSession();
// get bean from session
Bean Bean = (Bean) session.getAttribute("BeanId");
// example to call a getter-method from this bean
String value = AppFormBean.getValue();

hope this help
heiner
saahil sinha
Ranch Hand

Joined: Apr 07, 2003
Posts: 68
nope thts not what i intended to do anyways i found out the solution to my problem.Thanx a lot for the reply anyways.
What i intended to do is make my servlet communicate with my ejb for example my ejb will perform creation of accounts n stuff send the response to the servlet and servlet will send the response for output to jsp page.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Communication between a servlet and a bean