---
title: "What is ServletConfig object?"  
description: "What is ServletConfig object?"  
author: "Anonymous User"  
published: 2014-11-03  
updated: 2020-09-19  
canonical: https://www.mindstick.com/interview/2236/what-is-servletconfig-object  
category: "asp.net"  
tags: ["java", "session"]  
reading_time: 1 minute  

---

# What is ServletConfig object?

`javax.servlet.ServletConfig` is used to pass configuration information to Servlet. Every servlet has it’s own **ServletConfig** object and servlet container is responsible for instantiating this object. We can provide servlet init parameters in web.xml file or through use of WebInitParam annotation. We can use getServletConfig() method to get the ServletConfig object of the servlet.

## Answers

### Answer by Anonymous User

`javax.servlet.ServletConfig` is used to pass configuration information to Servlet. Every servlet has it’s own **ServletConfig** object and servlet container is responsible for instantiating this object. We can provide servlet init parameters in web.xml file or through use of WebInitParam annotation. We can use getServletConfig() method to get the ServletConfig object of the servlet.


---

Original Source: https://www.mindstick.com/interview/2236/what-is-servletconfig-object

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
