Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

session redirect or forward

 
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
 
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
 
Let's go to the waterfront with this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic