Help coderanch get a
new server
by contributing to the fundraiser
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

sharing data among applications in the same server

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
now i got the point. thanks william
 
Clowns were never meant to be THAT big! We must destroy it with this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic