File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes servlet related interview questions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "servlet related interview questions" Watch "servlet related interview questions" New topic

servlet related interview questions

Jhanavi Shivgami

Joined: Aug 10, 2004
Posts: 11
Hi all,

there are some servlet related questions, pl help me

1) what is the diff between ServletContext and ServletConfig and what is the relationship between the two?
2)what is the diff between server.xml and web.xml and what is the relationship between the two?

pl help me. is urgent.


Rahul Juneja
Ranch Hand

Joined: Aug 03, 2002
Posts: 425
Hi Jhanavi,

Difference between ServletConfig and ServletContext ?
ServletConfig is used to fetch the application specific data as the Initial parameters required for an application. Whereas ServletContext is used to get other details as to the applicatoin and server properties.
ServletConfig Object is passed in init() method which is further passed to the HTTPServlet Class.

Difference between server.xml and web.xml ?
Server.xml have the properties set which are required by the server as to the Cache size or some other properties, whereas web.xml contains properties specific to a web application.

Rahul Juneja

Rahul Juneja
ThoughtClicks -
I agree. Here's the link:
subject: servlet related interview questions
It's not a secret anymore!