This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes why we can't get RD from config? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "why we can Watch "why we can New topic
Author

why we can't get RD from config?

ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
Why we can get RequestDispatcher from Servlet Context? or rather Why we can't get RequestDispatcher from Servlet Config?

Thanks.
ramprasad madathil
Ranch Hand

Joined: Jan 24, 2005
Posts: 489

A ServletConfig object is used to serve initialization info to the Servlet. A ServletContext object is the one that's used by the Servlet at runtime to dynamically get handle to other context resources/objects. Both serve two different purposes.

You can theorotically, get a RD object from config too (see below), though it would actually access the context object for this



ram.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: why we can't get RD from config?
 
Similar Threads
getParameter() in GenericServlet
2 ways of getting a RequestDispatcher
RequestDispatcher Doubt??
HELP! Problems with Buffer/Response Committed
redirect to servlet