Hi,
I have several Struts-based webapps, and i want to let the user 'jump' between these apps. I want to know if it's possible to detect when the user is going to jump between apps, to copy some data stored in session, and retrieve the same data in the second app, so i can re-store it in session.
Thanks.
-
Jumping between apps with Struts (4 messages)
- Posted by: Eneko Gonzalez
- Posted on: February 02 2004 05:14 EST
Threaded Messages (4)
- Jumping between apps with Struts by stephen smithstone on February 02 2004 07:36 EST
- Jumping between apps with Struts by Eneko Gonzalez on February 02 2004 09:26 EST
-
Jumping between apps with Struts by Paul Strack on February 02 2004 12:14 EST
- one Application into another by Guillermo de Jesus Perez Chavero on June 14 2005 12:20 EDT
-
Jumping between apps with Struts by Paul Strack on February 02 2004 12:14 EST
- Jumping between apps with Struts by Eneko Gonzalez on February 02 2004 09:26 EST
-
Jumping between apps with Struts[ Go to top ]
- Posted by: stephen smithstone
- Posted on: February 02 2004 07:36 EST
- in response to Eneko Gonzalez
i would use a cache manager i.e . oscache / Tangosol Coherence Cache. or something else and write the users details to the cache using the username and then when the use moves between apps load the data back into the session -
Jumping between apps with Struts[ Go to top ]
- Posted by: Eneko Gonzalez
- Posted on: February 02 2004 09:26 EST
- in response to stephen smithstone
We are going to use a cache manager, but we don't know if whe should store all data in cache, or in session and only load from cache when the user moves to a new app, or what... Besides, we don't know the performance of these cache managers in a cluster environment, so we don't want to use the cache manager more than necesary. -
Jumping between apps with Struts[ Go to top ]
- Posted by: Paul Strack
- Posted on: February 02 2004 12:14 EST
- in response to Eneko Gonzalez
The best (standard-based) trick I have found for transferring session data in web apps is to retrieve a RequestDispatcher to a servlet in the other application, and forward the session data stored in as request attributes. Here is some pseudo-code:
// In webapp 1
public class SendSessionDataServlet ... {
public doGet(request, response) ... {
// Get dispatcher to servlet in app2:
ServletContext app1context = this.getServletConfig().getServletContext();
ServletContext app2context = app1Context.getContext("app-2-contextpath");
RequestDispatcher dispatcher =
app2context.getRequestDispatcher("/ReceiveSessionDataServlet");
// Copy session data to request and forward
Object value = request.getSession().getAttribute("session-value");
request.setAttribute("session-value", session-value);
dispatcher.forward(request, response);
}
}
// In webapp 2
public class ReceiveSessionDataServlet ... {
public doGet(request, response) ... {
// Retrieve session data from request
Object value = request.getAttribute("session-value");
request.getSession().setAttribute("session-value", session-value);
}
}
However, this is a cludge. A good cache manager would be a much better solution. I would only use the above trick for passing user-specific data, like security credentials to support a single-sign-on. -
one Application into another[ Go to top ]
- Posted by: Guillermo de Jesus Perez Chavero
- Posted on: June 14 2005 12:20 EDT
- in response to Paul Strack
Is it possible to include one application into another???
And manage the include application independent of the another?