• Post Reply Bookmark Topic Watch Topic
  • New Topic

sharing data among applications in the same server  RSS feed

 
yugandhar reddy
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guys,

I am new to web applications and i think i am at the right place to clear my doubts.

ok.. I have three applications deployed in tomcat and I have the requirement that I need to
pass data like "user_name" from one application to the other application. These three applications are sitting
in the same tomcat server. how can i send data to other applications sitting in the same server? Is that
do i need to use request or response. please a little bit of code response will help me a lot.

thanks

 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66153
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First, please explain why you need to do this. It can be a sign of a design problem.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Start by thinking about whether all these servlets should be in the same application context instead of separate ones.

Bill

 
yugandhar reddy
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
these applications are totally different so we have deployed them as a different applications
all they need is the user who has logged in. From one application we want to take the user
to other application(is this possible?) and also share information like user_name.
so my question is can we take the user from one application to other(same server) and can
we send the infomation also?

thanks for replying me "Bear Bibeault" and "William Brogden"
 
Mohamed Inayath
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the Application Server you are using?

In tomcat we have an option to share the context between the applications
if both applications reside in a same server.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can configure a C ookie so that it applies to the entire site instead of just one web app.

Bill
 
Mohamed Inayath
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bill,

Is it feasible to store user information within cookie?


 
yugandhar reddy
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can i use something like this?

<%String user_name = DBClass.getUserName();
session.setAttribute("user_name", user_name);%>

As the user doesn't close the browser the session will be same i think

and using the dispatcher i can switch to other application. am i right?


 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it feasible to store user information within cookie?


You should not expect to store a large volume of information, but enough of a unique user name/ID to enable all your applications to access the user information in a shared database or serialized object, sure. That is the reason C ookies exist.

The HttpSession mechanism is designed to keep web applications separate for security reasons.

Bill
 
yugandhar reddy
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
now i got the point. thanks william
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!