{"id":138129,"date":"2025-10-13T09:54:00","date_gmt":"2025-10-13T06:54:00","guid":{"rendered":"https:\/\/www.javacodegeeks.com\/?p=138129"},"modified":"2025-10-13T06:55:26","modified_gmt":"2025-10-13T03:55:26","slug":"how-to-retrieve-servlet-context-in-java","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/how-to-retrieve-servlet-context-in-java.html","title":{"rendered":"How to Retrieve Servlet Context in Java"},"content":{"rendered":"<p>In Java web applications, the <code>ServletContext<\/code> object provides a way to communicate with the servlet container and access application-level parameters and resources. It is shared across all servlets in the same web application and can be used to store global data. Let us delve into understanding the Java Servlet Context and its importance in building robust web applications.<\/p>\n<h2><a name=\"section-1\"><\/a>1. What\u2019s a ServletContext?<\/h2>\n<p>The <code>ServletContext<\/code> interface, part of the <code>javax.servlet<\/code> package, provides a way for a servlet to interact with its servlet container and share information at the application level. It represents the web application running in the container and is shared among all servlets and JSPs within that application. You can learn more about <code>ServletContext<\/code> from the <a href=\"https:\/\/jakarta.ee\/specifications\/servlet\/5.0\/jakarta-servlet-spec-5.0.html#servletcontext\" target=\"_blank\" rel=\"noopener\">official Jakarta Servlet specification<\/a>.<\/p>\n<p>Some key uses of <code>ServletContext<\/code> include:<\/p>\n<ul>\n<li>Reading context initialization parameters: You can define parameters in <code>web.xml<\/code> using <code>&lt;context-param&gt;<\/code> and read them in your servlet via <code>getInitParameter()<\/code>. <a href=\"#example-context-param\">See example below<\/a>.<\/li>\n<li>Sharing data between servlets: You can store attributes in the context using <code>setAttribute()<\/code> and retrieve them with <code>getAttribute()<\/code>, which allows communication between multiple servlets.<\/li>\n<li>Accessing resources: You can obtain real paths to files in the web application using <code>getRealPath()<\/code>, access resources as streams with <code>getResourceAsStream()<\/code>, and use <code>getRequestDispatcher()<\/code> for forwarding or including content.<\/li>\n<\/ul>\n<p>In short, <code>ServletContext<\/code> acts as a bridge between your servlets\/JSPs and the underlying servlet container, enabling resource access, configuration reading, and data sharing at the application scope. It is a powerful tool for managing global application state and facilitating communication between different components of a web application.<\/p>\n<h2><a name=\"section-2\"><\/a>2. Accessing the ServletContext Inside a Servlet<\/h2>\n<p>There are multiple ways to access the <code>ServletContext<\/code> inside a servlet. Let&#8217;s explore them with examples.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<h3>2.1 Using getServletContext() Method<\/h3>\n<p>Each servlet has a <code>getServletContext()<\/code> method to access the context.<\/p>\n<pre class=\"brush:java; wrap-lines:false;\">import java.io.IOException;\nimport javax.servlet.ServletException;\nimport javax.servlet.annotation.WebServlet;\nimport javax.servlet.http.HttpServlet;\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport javax.servlet.ServletContext;\n\n@WebServlet(\"\/contextExample\")\npublic class ContextExampleServlet extends HttpServlet {\n    protected void doGet(HttpServletRequest request, HttpServletResponse response)\n            throws ServletException, IOException {\n        \/\/ Get the ServletContext\n        ServletContext context = getServletContext();\n\n        \/\/ Set an attribute\n        context.setAttribute(\"appName\", \"My Web Application\");\n\n        \/\/ Get the attribute\n        String appName = (String) context.getAttribute(\"appName\");\n\n        response.setContentType(\"text\/html\");\n        response.getWriter().println(\"&lt;h2&gt;Application Name: \" + appName + \"&lt;\/h2&gt;\");\n    }\n}\n<\/pre>\n<p>In this example, we define a servlet <code>ContextExampleServlet<\/code> mapped to the URL <code>\/contextExample<\/code>. Inside the <code>doGet()<\/code> method, we first retrieve the <code>ServletContext<\/code> object using <code>getServletContext()<\/code>. We then set an attribute named <code>appName<\/code> with the value &#8220;My Web Application&#8221;, which can be shared across all servlets in this web application. Next, we retrieve the same attribute from the context and store it in a <code>String<\/code> variable <code>appName<\/code>. Finally, we set the response content type to <code>text\/html<\/code> and write the application name as an <code>&lt;h2&gt;<\/code> heading in the browser. This demonstrates how a servlet can store and access application-wide data using <code>ServletContext<\/code>.<\/p>\n<h3>2.2 Accessing ServletContext via ServletConfig<\/h3>\n<p>Each servlet receives a <code>ServletConfig<\/code> object during initialization. You can get the context from it using <code>getServletContext()<\/code>.<\/p>\n<pre class=\"brush:java; wrap-lines:false;\">import javax.servlet.ServletConfig;\nimport javax.servlet.ServletContext;\nimport javax.servlet.ServletException;\nimport javax.servlet.http.HttpServlet;\n\npublic class ConfigContextServlet extends HttpServlet {\n    private ServletContext context;\n\n    public void init(ServletConfig config) throws ServletException {\n        super.init(config);\n        \/\/ Access ServletContext from ServletConfig\n        context = config.getServletContext();\n        context.setAttribute(\"version\", \"1.0\");\n    }\n}\n<\/pre>\n<p>In this example, the servlet <code>ConfigContextServlet<\/code> demonstrates accessing the <code>ServletContext<\/code> via the <code>ServletConfig<\/code> object. During servlet initialization, the <code>init(ServletConfig config)<\/code> method is called by the servlet container. Inside this method, we first call <code>super.init(config)<\/code> to ensure the servlet is properly initialized. We then retrieve the <code>ServletContext<\/code> using <code>config.getServletContext()<\/code> and store it in a private variable <code>context<\/code>. Finally, we set an application-wide attribute <code>version<\/code> with the value &#8220;1.0&#8221;. This approach is useful when you need access to the servlet context during the initialization phase, before any requests are processed.<\/p>\n<h3>2.3 Accessing ServletContext from JSP<\/h3>\n<p>In JSP, <code>application<\/code> is an implicit object that represents the ServletContext.<\/p>\n<pre class=\"brush:plain; wrap-lines:false;\">&lt;% \n    String version = (String) application.getAttribute(\"version\");\n    out.println(\"&lt;h2&gt;App Version: \" + version + \"&lt;\/h2&gt;\");\n%&gt;\n<\/pre>\n<p>In this JSP example, we demonstrate how to access the <code>ServletContext<\/code> using the implicit object <code>application<\/code>. The <code>application<\/code> object automatically represents the ServletContext of the web application. We retrieve the attribute <code>version<\/code> that was previously set by a servlet using <code>application.getAttribute(\"version\")<\/code> and store it in a <code>String<\/code> variable named <code>version<\/code>. Finally, we use <code>out.println()<\/code> to display the application version as an <code>&lt;h2&gt;<\/code> heading in the browser. This method allows JSP pages to easily access shared application-level data without needing a separate servlet.<\/p>\n<h2><a name=\"section-3\"><\/a>3. Conclusion<\/h2>\n<p>The <code>ServletContext<\/code> is an essential part of Java web applications. It allows servlets to share data, read configuration parameters, and interact with the web container. You can access it directly using <code>getServletContext()<\/code>, via <code>ServletConfig<\/code>, or through JSP implicit objects. Choosing the right method depends on your specific use case and where you need the context.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In Java web applications, the ServletContext object provides a way to communicate with the servlet container and access application-level parameters and resources. It is shared across all servlets in the same web application and can be used to store global data. Let us delve into understanding the Java Servlet Context and its importance in building &hellip;<\/p>\n","protected":false},"author":26931,"featured_media":112,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[1200,845],"class_list":["post-138129","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-java","tag-servlet"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Retrieve Servlet Context in Java - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"Java servlet context: Explore different ways to access and use Java Servlet Context in servlets and JSP applications.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/how-to-retrieve-servlet-context-in-java.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Retrieve Servlet Context in Java - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"Java servlet context: Explore different ways to access and use Java Servlet Context in servlets and JSP applications.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/how-to-retrieve-servlet-context-in-java.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2025-10-13T06:54:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Yatin Batra\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Yatin Batra\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/how-to-retrieve-servlet-context-in-java.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/how-to-retrieve-servlet-context-in-java.html\"},\"author\":{\"name\":\"Yatin Batra\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/cda31a4c1965373fed40c8907dc09b8d\"},\"headline\":\"How to Retrieve Servlet Context in Java\",\"datePublished\":\"2025-10-13T06:54:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/how-to-retrieve-servlet-context-in-java.html\"},\"wordCount\":603,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/how-to-retrieve-servlet-context-in-java.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"keywords\":[\"Java\",\"Servlet\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/how-to-retrieve-servlet-context-in-java.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/how-to-retrieve-servlet-context-in-java.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/how-to-retrieve-servlet-context-in-java.html\",\"name\":\"How to Retrieve Servlet Context in Java - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/how-to-retrieve-servlet-context-in-java.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/how-to-retrieve-servlet-context-in-java.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"datePublished\":\"2025-10-13T06:54:00+00:00\",\"description\":\"Java servlet context: Explore different ways to access and use Java Servlet Context in servlets and JSP applications.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/how-to-retrieve-servlet-context-in-java.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/how-to-retrieve-servlet-context-in-java.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/how-to-retrieve-servlet-context-in-java.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"width\":150,\"height\":150,\"caption\":\"java-interview-questions-answers\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/how-to-retrieve-servlet-context-in-java.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"How to Retrieve Servlet Context in Java\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/cda31a4c1965373fed40c8907dc09b8d\",\"name\":\"Yatin Batra\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/12\\\/Yatin.batra_.jpg\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/12\\\/Yatin.batra_.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/12\\\/Yatin.batra_.jpg\",\"caption\":\"Yatin Batra\"},\"description\":\"An experience full-stack engineer well versed with Core Java, Spring\\\/Springboot, MVC, Security, AOP, Frontend (Angular &amp; React), and cloud technologies (such as AWS, GCP, Jenkins, Docker, K8).\",\"sameAs\":[\"https:\\\/\\\/www.javacodegeeks.com\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/yatin-batra\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Retrieve Servlet Context in Java - Java Code Geeks","description":"Java servlet context: Explore different ways to access and use Java Servlet Context in servlets and JSP applications.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/how-to-retrieve-servlet-context-in-java.html","og_locale":"en_US","og_type":"article","og_title":"How to Retrieve Servlet Context in Java - Java Code Geeks","og_description":"Java servlet context: Explore different ways to access and use Java Servlet Context in servlets and JSP applications.","og_url":"https:\/\/www.javacodegeeks.com\/how-to-retrieve-servlet-context-in-java.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2025-10-13T06:54:00+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","type":"image\/jpeg"}],"author":"Yatin Batra","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Yatin Batra","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/how-to-retrieve-servlet-context-in-java.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/how-to-retrieve-servlet-context-in-java.html"},"author":{"name":"Yatin Batra","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/cda31a4c1965373fed40c8907dc09b8d"},"headline":"How to Retrieve Servlet Context in Java","datePublished":"2025-10-13T06:54:00+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/how-to-retrieve-servlet-context-in-java.html"},"wordCount":603,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/how-to-retrieve-servlet-context-in-java.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","keywords":["Java","Servlet"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/how-to-retrieve-servlet-context-in-java.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/how-to-retrieve-servlet-context-in-java.html","url":"https:\/\/www.javacodegeeks.com\/how-to-retrieve-servlet-context-in-java.html","name":"How to Retrieve Servlet Context in Java - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/how-to-retrieve-servlet-context-in-java.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/how-to-retrieve-servlet-context-in-java.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","datePublished":"2025-10-13T06:54:00+00:00","description":"Java servlet context: Explore different ways to access and use Java Servlet Context in servlets and JSP applications.","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/how-to-retrieve-servlet-context-in-java.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/how-to-retrieve-servlet-context-in-java.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/how-to-retrieve-servlet-context-in-java.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","width":150,"height":150,"caption":"java-interview-questions-answers"},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/how-to-retrieve-servlet-context-in-java.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"How to Retrieve Servlet Context in Java"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/cda31a4c1965373fed40c8907dc09b8d","name":"Yatin Batra","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/12\/Yatin.batra_.jpg","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/12\/Yatin.batra_.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/12\/Yatin.batra_.jpg","caption":"Yatin Batra"},"description":"An experience full-stack engineer well versed with Core Java, Spring\/Springboot, MVC, Security, AOP, Frontend (Angular &amp; React), and cloud technologies (such as AWS, GCP, Jenkins, Docker, K8).","sameAs":["https:\/\/www.javacodegeeks.com"],"url":"https:\/\/www.javacodegeeks.com\/author\/yatin-batra"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/138129","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/26931"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=138129"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/138129\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/112"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=138129"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=138129"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=138129"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}