• 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
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

interservlet communication

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi
iam new to interservlet communication .But iam familiar with
servlet part.Now only i am planning to write interservlet
communication .iam using jswdk1.0.1 .using i can write interservlet communication .explain with few examples how one servlet communicates with the other servlet
greetings
bala
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Get the Servelt Context using getServletContext() method.
Then invoke a method on the Servlet Context object called getServlet("name of the servlet to be communicated")
Then cast the result to the specifed servlet and then use that refernce for ur further process.
Sample Code just a frame work) Servlet1 and Servlet2 are the
Servlet classes to be communicated.
public class Servlet1 extends HttpServlet
{
ServletContext cxt = getServletContext();
Servlet2 sl2 = (Servlet2)cxt.getServlet("Servlet2");
}
Hope this clear ur doubt!!!
If u have further doubts, let me know
 
I didn't say it. I'm just telling you what this tiny ad said.
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic