File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servletContext()

 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
what is a servletContext()?
if i run tomcat then all the servlets that r run from that tomcat instance is said to be in one servletContext(). right?
then what is meant when we say we want to have communication b/w two servletContexts??? two tomcats r running on the same machine or different machines?
regards
maulin.
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

if i run tomcat then all the servlets that r run from that tomcat instance is said to be in one servletContext(). right?

errrrr.......wrong.
A ServletContext is the context in which a given servlet is running. This will be your web-application. In other words, ServletContext is the application in which a servlet is available.
When you say communication between two ServletContexts, its like communicating between two web applications. I have never done this, but theoritically speaking this is possible.
So, ONE Tomcat running on a machine allowing different applications available, to exchange data (communicating).
regds.
- satya
 
Vamsidhar Chenepalli
Greenhorn
Posts: 22
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
rephasing Satya's words..
Every App. server can have multiple web-applications. Each web application will have one servlet context under wihch all the servlets of the perticular applications will run.
Each web app. is mapped to a logical path on the server.
Servlets with in a web app. can communicate with each other using servlet context. For a detailed discussion read SRV.3 from servlet specification.
hope this helps
Vamsi
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic