{"id":478,"date":"2014-05-19T08:35:49","date_gmt":"2014-05-19T08:35:49","guid":{"rendered":"http:\/\/codethataint.com\/blog\/?p=478"},"modified":"2015-12-21T08:41:42","modified_gmt":"2015-12-21T08:41:42","slug":"the-method-getservletcontext-is-undefined-for-the-type-httpservletrequest","status":"publish","type":"post","link":"https:\/\/codethataint.com\/blog\/the-method-getservletcontext-is-undefined-for-the-type-httpservletrequest\/","title":{"rendered":"The method getServletContext() is undefined for the type HttpServletRequest"},"content":{"rendered":"<p><strong>The method getServletContext() is undefined for the type HttpServletRequest<\/strong><\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\n  ServletContext context = request.getServletContext();\r\n<\/pre>\n<p>getServletContext() is available from HttpServlet class that your servlet extended. You can invoke the method as if it were defined in your own servlet class<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\n  ServletContext context = getServletContext();\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The method getServletContext() is undefined for the type HttpServletRequest ServletContext context = request.getServletContext(); getServletContext() is available from HttpServlet class that your servlet extended. You can invoke the method as if it were defined in your own servlet class ServletContext context = getServletContext();<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-478","post","type-post","status-publish","format-standard","hentry","category-servlets"],"_links":{"self":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/478","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/comments?post=478"}],"version-history":[{"count":2,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/478\/revisions"}],"predecessor-version":[{"id":1067,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/478\/revisions\/1067"}],"wp:attachment":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/media?parent=478"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/categories?post=478"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/tags?post=478"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}