Dear JavaPros,
I have an issue with using the ServletContext class for passing objects between applications. The application that we are trying to develop is a conglomerate of different web apps deployed to jakarta-tomcat-4.1.12 servlet engine. Each web app has its own controller servlet and is a full fledged application that can function independently. What I am trying to do is to login to one app and then try to access other apps from there on without any additional authentication to use the other web apps.
Let us call the apps webappA and webappB
When I log in to webappA, I need to create
an object of a UserProfile class which I wrote
as a utility class which stores a lot of the user
information retrieved from a backend ADABAS file.
I need to pass this UserProfile to other apps which
the user would like to navigate to.
In other words, I need to do something like the code below
webappA/ServletA
ServletContext webappAContext = getServletContext();
UserProfile userProfile = UserProfile.retrieve("userId");
webappAContext.setAttribute("someId", userProfile);
In webappB/ServletB
ServletContext webappBContext = getServletContext();
ServletContext webappAContext = webappBContext.getContext("/webappA");
UserProfile userProfile = (UserProfile) webappAContext.getAtribute("someId");
The question is the ServletB must know a unique identifier ("someId") with which it can
retrieve the UserProfile object. I am at a loss to figure out how this could
be done.
Any thoughts on this one?
Thanks and Best Regards,
Sunil
-
session management (4 messages)
- Posted by: Web Master
- Posted on: November 27 2002 14:47 EST
Threaded Messages (4)
- session management by Eduardo Estefano on November 28 2002 11:08 EST
- session management by arun kumar on November 29 2002 00:31 EST
-
session management by Mauro Ramon on November 29 2002 05:26 EST
- session management by Web Master on November 29 2002 09:02 EST
-
session management by Mauro Ramon on November 29 2002 05:26 EST
- session management by arun kumar on November 29 2002 00:31 EST
-
session management[ Go to top ]
- Posted by: Eduardo Estefano
- Posted on: November 28 2002 11:08 EST
- in response to Web Master
pass the Id in the URL as a request parameter -
session management[ Go to top ]
- Posted by: arun kumar
- Posted on: November 29 2002 00:31 EST
- in response to Eduardo Estefano
Any how you are accessing applications from same browser, When you are accessing first application put that 'some id' in session and later on when you are accessing second application you can get it back. -
session management[ Go to top ]
- Posted by: Mauro Ramon
- Posted on: November 29 2002 05:26 EST
- in response to arun kumar
Two diferent web application can share the same session???
session == request.getSession(true) ???? -
session management[ Go to top ]
- Posted by: Web Master
- Posted on: November 29 2002 09:02 EST
- in response to Mauro Ramon
I have not tried this. But I feel that two different web applications use separate sessions and therefore may not work.