Hello.
I hope someone can help me with this basic question.

I have 2 separate applications, app1 and app2. One jsp
and one servlet in each. 
>From the jsp I send some parameters to the servlet. I
prosess them and put the answer in a session variable
like this:

servlet1.java:
  String strP1 = request.getParameter("param1");
  String strP2 = request.getParameter("param2");

... procsess them
  String strAnswer = strP1 + strP2;

Get the session.
  session = request.getSession(true);
Put a session variable.
  session.setAttribute("result", strAnswer);
  ...

Now I want to send the session to the other
application, app2, where the jsp file reads the
session variable and displays it.

jsp2.jsp:
<%
String str = (String)session.getAttribute("result");
out.println("result: " + str);
%>

I have put shared="true" in both web-app tags.
 <web-app application="App1" name="App1-web"
root="/app1" shared="true" />
 <web-app application="App2" name="App2-web"
root="/app2" shared="true" />

Ok. If I do in sevlet1.java:

  disp=context.getRequestDispatcher("/app2/app2.jsp");
  disp.forward(request,response);

I get a: 404 Not Found...............

If I use sendRedirect(..,..)  the session is not
shared, it is empty.

How can I connect the 2 applications? Did I miss andy
configuration setting? And how to send the session to
the other application. It seem setting shared=true
means something else than I thought.

Greatfull for any hint.
Tomas


__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/

Reply via email to