aspose file tools*
The moose likes Servlets and the fly likes 2 or more servlet sharing data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "2 or more servlet sharing data " Watch "2 or more servlet sharing data " New topic
Author

2 or more servlet sharing data

vinaya kumar thimmappa
Greenhorn

Joined: May 29, 2006
Posts: 3
how to design such a stuff using tomcat


vinaya
kamlesh tayade
Ranch Hand

Joined: Sep 21, 2005
Posts: 34
use javaBean for the data sharing


Kamlesh
Be oN edGE SCJP 1.4, on edGE for SCWCD 1.4
Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3636
Can you just share more details about your requirement? What is the business objective?


My blood is tested +ve for Java.
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

You may store the data as in request or session scope as required.


Groovy
vinaya kumar thimmappa
Greenhorn

Joined: May 29, 2006
Posts: 3
i am looking at various ways to share say some "input data" from user across servlets.

One way to do this is pass it using session variable or command line
is there any other way. I am not sure of using servlet context. Can we use this
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Originally posted by vinaya kumar thimmappa:
i am looking at various ways to share say some "input data" from user across servlets.

One way to do this is pass it using session variable or command line
is there any other way. I am not sure of using servlet context. Can we use this


Can you tell us more about the data you want to share across servlets. Whether it can be used across multiple threads etc.
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
Originally posted by vinaya kumar thimmappa:
i am looking at various ways to share say some "input data" from user across servlets.

One way to do this is pass it using session variable or command line
is there any other way. I am not sure of using servlet context. Can we use this


Ofcourse context is sharable across all part of web application and so by all servlet.
But as everybody said, what is the requirement???
Vince HW Chan
Greenhorn

Joined: Aug 16, 2005
Posts: 5
If the data is shared among all users in the same application,
then store it using servletcontext.

If the data is shared by only the user who created it,
the store it using session.

If the data is static and configured,
then create a single bean to store it and called it as a singleton.

If the data is not serializable or is too big in size,
put it in DB or file for sharing.

Anyone agree?
 
Don't get me started about those stupid light bulbs.
 
subject: 2 or more servlet sharing data