• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

forwarding to a different webApp

 
Ranch Hand
Posts: 216
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello everyone,
Can someone give me some pointers how to forward the request to a servlet or a jsp page but in *different* web Application?
I would really appreciate help.
Vladan
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
I do not know if it can help but you can use a sendRedirect to redirect on a url on a other application server.
see httpServletResponce.sendRedirect. If it is not what you want sorry!
------------------
Benjamin l�onard
www.evisor.com
 
author
Posts: 3252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Vladan Radovanovic:
Can someone give me some pointers how to forward the request to a servlet or a jsp page but in *different* web Application?


You can only forward a request to a web-app inside the same engine. As you know, a RequestDispatcher will only work for a specific context (web-app). The trick is to first get the context for the web-app you want to forward to, and then get the RequestDispatcher from that context.
Say your other web-app root is "/your/other/web/app/root", and the servlet you want to forward to is "/servlets/theServlet" (its URI is "/your/other/web/app/root/servlets/theServlet").

If the servlet runs on a different server, you've got no choice but to use sendRedirect.
- Peter
 
Vladan Radovanovic
Ranch Hand
Posts: 216
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Peter, that is exactly what I thougth.
Thank You very much.
Vladan
 
A sonic boom would certainly ruin a giant souffle. But this tiny ad would protect it:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic