This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

A Question in ServletContext

 
Vasantha Prabha
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can any one tell me why do we need
Context.getContext()
Regards,
Sangeetha
 
Kevin Jones
Author
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The getContext method takes a string. This is the URI to a different ServletContext running within this container. Once you have this reference you can then call getRequestDispatcher on that context and dispatch requests to servlets running in other web apps. Now,
i) this is probably not a good idea
ii) Containers may prevent this for security reasons
 
danny liu
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
that means you wanna access a resource beneath another application.
be careful when you are doing do.
hope that helps.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic