Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

session redirect or forward

 
Claudia Vaz
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello
I have two web apllications in the Weblogic server but in different context roots.
From a Jsp page of the first application i want to do a forward or redirect to the other application and pass some parameters.
I have the parameters in the session (session.setAttribute(..)), but i can change it.
If i do "response.sendRedirect("http://localhost:7001/application2.jsp")" i lose the session!
If i use the "<jsp:forward page="../application2/index.jsp"/>", it does not work beacause the applications are in differents contexts!
How can i resolve this???
I can always do response.sendRedirect("http://localhost:7001/application2/index.jsp?parameter1=xpto¶meter2=gggg") but this is no a very nice way if i have many parameters to pass.

Thanks in advance
Hope somemone helps
Claudia Vaz
 
Sanjeev Kaushik
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
You can try this
ServletContext context = application.getContext("/demo");//path of other application
RequestDispatcher rd = context .getRequestDispatcher("/demo/inner.jsp");
rd.farword(request,response);

This will pass your request object to another jsp

Sanjeev Kaushik
 
Claudia Vaz
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello
The solution does not work! The method getServletContext() is not known!!!
I did the import of java.servlet.* but it stills not recognize the method!

Claudia Vaz
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!