We have two applications in that we have two servlets each.How they(servlets) communicate with each other ?

Showing Answers 1 - 14 of 14 Answers

kailash

  • Oct 4th, 2005
 

 connect both application with same data base

1.

2. update the data close the connection

3 call the II app to

  Was this answer useful?  Yes

Vara Allamaraju

  • Dec 12th, 2005
 

If both the applications are deployed on the same app server, they can communicate with each other.

ServletContext has a method called getContext(String uripath) that returns a servletContext object that corresponds to that specified URL on the server.

  Was this answer useful?  Yes

miz

  • Jan 31st, 2006
 

There is a few ways to achive the goal respect with diffrent circumstance and requirement:

1 Create a sigleton encapusalting the shared info,  if  two serverlets are running in same JVM. but you have to be very careful about the synchronization

2 Use DB to cache the shared info if there is a db in place

  Was this answer useful?  Yes

Lalit Rawat

  • Nov 6th, 2006
 

Sorry Guys,

There are two ways:

1. sendRedirect

2. define the url of the other application in action attribute of the <form> tag. when ur form submits, the request object will go to that url.

Lalit 

  Was this answer useful?  Yes

indian

  • Nov 9th, 2007
 

In same JVM it is ok. If it is different JVM's  all answers above mentioned never workout.

  Was this answer useful?  Yes

pvrayudu

  • Feb 26th, 2008
 

To have your servlet access another resource such as another servlet, a JSP
page, or a CGI script, you can either:


Have the servlet make an HTTP request.


Make a request of the resource using a RequestDispatcher object, if the
resource is available from the server that is running the servlet.


  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions