Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

What is the need of a special ServletConfig object for every servlet

843841Nov 8 2006 — edited Nov 9 2006
What is the need of a special ServletConfig object for every servlet ?

Let me be more precise . If it is only to get the initial parameters ,then i can do the same inside a servlet also . I can make a data member in my extended Servlet class like :-
public class MyServlet extends HttpServlet 
{
      String name;

}
And i can initialize that member in the overridden init() method of the MyServlet class .
Again from my SertvletConfig i can get a reference to ServletContext . But straight way by using getServletContext() method inside the servlet a can get the same .

Then why i need a special ServletConfig object for every servlet ?
I am looking for something which is more specific for the ServletConfig object .In other word that function can only be done by the ServletConfig object . Pls reply soon .

With regards
Arunabh Dash
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 7 2006
Added on Nov 8 2006
2 comments
107 views