communication between jspBeans & servlets

G

Gary N.

Hi -

Do jspbeans and javaservlets have the ability to communicate with each
other? The bean and the servlet are in the same .war file.

Specifically, inside the servlet I need to be able to see the Bean data, but
communicating both directions would be nice too. If I send the data back
and forth through the JSP page, that will work, but it seems VERY
inefficient.

Suggestions would be great!

Thanks!

Gary
 
W

Wendy S

Gary N. said:
Do jspbeans and javaservlets have the ability to communicate with each
other? The bean and the servlet are in the same .war file.

I consider a "bean" to be a JavaBean-- just a container class with some
properties and get/set methods. As such, they don't really *do* anything
(such as communicate) they just *are*. JSPBean is not a term I'm familiar
with, do you have a link? (Enterprise JavaBeans are an entirely different
animal.)
Specifically, inside the servlet I need to be able to see the Bean data, but
communicating both directions would be nice too. If I send the data back
and forth through the JSP page, that will work, but it seems VERY
inefficient.

What typically happens is that you instantiate a bean in the Servlet code,
set a bunch of properties, [sometimes by reading from a database, or using
other helper classes to process data] then put the bean in request or
session scope and forward to a JSP which displays the data stored in the
bean.

HTH,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,225
Members
46,815
Latest member
treekmostly22

Latest Threads

Top