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
ServletContext webappAContext = getServletContext();
UserProfile userProfile = UserProfile.retrieve("userId");
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
Any thoughts on this one?
Thanks and Best Regards,
pass the Id in the URL as a request parameter
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.
Two diferent web application can share the same session???
session == request.getSession(true) ????
I have not tried this. But I feel that two different web applications use separate sessions and therefore may not work.