This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Building Blockchain Apps and have Michael Yuan on-line!
See this thread for details.
Win a copy of Building Blockchain Apps this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

sharing data among applications in the same server

 
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

 
Marshal
Posts: 67366
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • 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.
 
Author and all-around good cowpoke
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"
 
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
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
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
 
There’s no place like 127.0.0.1. But I'll always remember this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!