• 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

Communication between servlets on diff war file, but same app server

 
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How can we talk to another servlet residing at two differetn war but same ear file deployed in same app server..

Thanks

Mohan
 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You mean both servlets are in dfferent contexts and the part of different applications.

You can call "sendRedirect()" by passing an absolute URL. But you will not be able to share the same session and application context.
 
Mohan Karthick
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I mean that one servlet is calling other servlet and getting some output from that, and both servlet is having different servletcontext as these are in different war file but single ear file.

suppose one war file is just for authetication purpose I want to query a DB from this servlet and get some constant. once i get this constant i can check the main servlet whether user have given same constant or not.
basically i want to invoke a public method of a servlet(diff war) from my a servlet in my war.

I understand that this is not needed logically, we can do it in one war file, but take the scenario

send redirect will create a new request, and pervious request will no more available.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would avoid spreading your app out over different war files unless you have a real pressing need to do so.

You can't carry a session or request from one context to another.
reply
    Bookmark Topic Watch Topic
  • New Topic