Skip to main content

ServletConfig in Servlet

ServletConfig is just only a object created by container itself.When servlet is loaded on the server at that time container make the servletconfig object by which you can simply do any required change in Web.xml file directly without disturbing any specific servlet. All the configurations can directly change by manipulating in a web.xml file there is no need to modifications in relevant servlet class file. ServletConfig is a interface actually who's object is created by container. by using that object we can do various changes in a servlet files without even touching that servlet file. There are 4 methods available in this interface as: 1 > getInitParameter(); 2 > getInitParameterNames(); 3 > getServletName(); 4 > getServletContext();

Comments

Popular posts from this blog

Deloitte Interview Problem Reverse run-length encoding & decoding of a given string

Observability & Monitoring through Loki,Promtail (Alloy),Prometheus,Micrometer in Grafana

🔧 What this demo covers End-to-end observability setup using Prometheus + Loki + Grafana Integration of Micrometer with Spring Boot for real-time metrics Log collection using Promtail / Alloy from application containers 📊 Metrics Monitoring (Prometheus) Scraping metrics from /actuator/prometheus endpoint JVM metrics: memory, threads, GC activity HTTP metrics: request count, latency, error rates Custom metrics via Micrometer 📜 Centralized Logging (Loki + Promtail) Aggregates logs from multiple microservices Label-based log filtering (fast & efficient) No heavy indexing → lightweight compared to ELK 📈 Visualization (Grafana Dashboards) Real-time dashboards for metrics & logs Correlate logs with metrics for faster debugging Pre-built + custom dashboards ⚙️ Architecture Flow Spring Boot app → exposes metrics via Micrometer Prometheus → scrapes & stores metrics Promtail/Alloy → collects logs → pushes to Loki...