• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Call a Servlet from another app

 
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys, this might most be possible. We have 2 applications that integrates seemlessly with each other. Now, we have a problem of destroying the session of both applications when the user logoff. Would it be possible for a Servlet to sendRedirect or forward to another servlet from another application?

App1(Logoff.do, destroy session) ----> App2(Logoff.do, destroy session) ----> App1(login.do)


I'm not using Struts, the .do is just a convention.... Thanks!
 
Ranch Hand
Posts: 3852
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Timothy Sam:
Hi guys, this might most be possible. We have 2 applications that integrates seemlessly with each other. Now, we have a problem of destroying the session of both applications when the user logoff. Would it be possible for a Servlet to sendRedirect or forward to another servlet from another application?

App1(Logoff.do, destroy session) ----> App2(Logoff.do, destroy session) ----> App1(login.do)


I'm not using Struts, the .do is just a convention.... Thanks!



You can sendRedirect() to resource which is not in your application but not forward().

But I think, through sendRedirect(), it's not possible to send sth with request...

May be you can have a central place (DB or XML or something) for communication between both the application. :roll:
[ November 22, 2006: Message edited by: rathi ji ]
 
Timothy Sam
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you very much! It seems that I need to put the complete URL String which is

http://www.google.com

because www.google.com just won't work in sendRedirect. Thank you!
 
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Timothy Sam:
Thank you very much! It seems that I need to put the complete URL String which is

http://www.google.com

because www.google.com just won't work in sendRedirect. Thank you!



Send redirect actually works from the client side.

Consider a situation where you log off from application 1 and then the first application after invalidating the session , sends a sendRedirect for the logoff of the second application.
Before the client opens the new fresh connection with the second web application , you close the browser. In that case your system goes to a inconsistent state.

forward jsp tag works for forwarding to other web applications also.Check how that works.
reply
    Bookmark Topic Watch Topic
  • New Topic