{"id":66302,"date":"2021-07-18T11:24:35","date_gmt":"2021-07-18T15:24:35","guid":{"rendered":"http:\/\/bangla.salearningschool.com\/recent-posts\/essential-knowledge-on-web-component-development-java-short-notes\/"},"modified":"2021-07-18T11:24:35","modified_gmt":"2021-07-18T15:24:35","slug":"essential-knowledge-on-web-component-development-java-short-notes","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=66302","title":{"rendered":"Essential Knowledge on Web Component Development #Java Short Notes"},"content":{"rendered":"<ul>\n<li> doGet() processes HEAD requests in the absence of a doHead() method<\/li>\n<li> Not the service() method but the methods that are called by the service method are better candidates for overriding <\/li>\n<li>HttpServlet supports GET, POST, DELETE, OPTIONS, and TRACE requests<\/li>\n<li> Retrieve a single value for a form parameter named &#8220;username&#8221;: String u = request.getParameter(&#8220;username&#8221;);,\tString u = request.getParameterValues(&#8220;username&#8221;)[0]; <\/li>\n<li> java.util.Enumeration getHeaderNames() &#8211; retrieves the complete collection of request headers<\/li>\n<li> set the content type of a servlet response: <br \/>response.setContentType(&#8220;text\/html&#8221;);<br \/>response.setHeader(&#8220;Content-Type&#8221;, &#8220;text\/html&#8221;); <br \/> \tresponse.addHeader(&#8220;Content-Type&#8221;, &#8220;text\/html&#8221;); <\/li>\n<li> Servlet.destroy(): Servlets release resources: When called, the servlet container may not route other requests to that instance of the servlet: Servlet.destroy() may never be called<\/li>\n<li> The destroy() method, called by the web container when the servlet (or the web application) is being shutdown. This is a very good place to put the code to close related socket connection<\/li>\n<li> no guarantee on when the finalize() method will be called by the JVM<\/li>\n<li> The init() method is called by the web container before any HTTP requests are processed by the servlet. This is a good place to open a socket connection<\/li>\n<li> web.xml, JAR files, Class files, the deployment descriptor &#8211; are expected to be placed under WEB-INF directory<\/li>\n<li> A welcome file: used when a user requests a directory <\/li>\n<li>welcome files may be used at any directory level<\/li>\n<li> the default servlet is used to handle requests for specific files that exist in the webapp<\/li>\n<li> By default, the web container sends a 404 error back if the requested file does not exist<\/li>\n<li> Define a mime-mapping:pdfapplication\/pdf<\/li>\n<li> WAR files are created using the jar command.<\/li>\n<li> A web application may be packaged into a WAR file for deployment, but it is not required. <\/li>\n<li> The files within the WEB-INF directory and the files within the META-INF directory of a WAR file must not be directly served as content by the container in response to a Web client&#8217;s request.<\/li>\n<li> A webapp can only have one web.xml file and all configuration must exist in that one file even if the Java class files exist in some other package<\/li>\n<li>String boundObjectName = getServletContext().getInitParameter(&#8220;com.example.BoundObj&#8221;);:returns a String if an initializathttp:\/\/www.justetc.net\/knowledge\/editArticlesNext.phphttp:\/\/www.justetc.net\/knowledge\/editArticlesNext.phpion parameter of that name exists in web.xml<\/li>\n<li>session.removeAttribute(&#8220;app.util.DataSource&#8221;);: removes a session attribute<\/li>\n<li> Servlet context listeners are notified when the context is ready to process requests and when it is about to be shut down<\/li>\n<li> HttpSession.setAttribute(String attributeName,Object value): method stores an object<\/li>\n<\/ul>\n<p> From: http:\/\/sitestree.com\/?p=4929<br \/> Categories:Java Short Notes<br \/>Tags:<br \/> Post Data:2008-09-09 09:45:43<\/p>\n<p>\t\tShop Online: <a href='https:\/\/www.ShopForSoul.com\/' target='new' rel=\"noopener\">https:\/\/www.ShopForSoul.com\/<\/a><br \/>\n\t\t(Big Data, Cloud, Security, Machine Learning): Courses: <a href='http:\/\/Training.SitesTree.com' target='new' rel=\"noopener\"> http:\/\/Training.SitesTree.com<\/a><br \/>\n\t\tIn Bengali: <a href='http:\/\/Bangla.SaLearningSchool.com' target='new' rel=\"noopener\">http:\/\/Bangla.SaLearningSchool.com<\/a><br \/>\n\t\t<a href='http:\/\/SitesTree.com' target='new' rel=\"noopener\">http:\/\/SitesTree.com<\/a><br \/>\n\t\t8112223 Canada Inc.\/JustEtc: <a href='http:\/\/JustEtc.net' target='new' rel=\"noopener\">http:\/\/JustEtc.net (Software\/Web\/Mobile\/Big-Data\/Machine Learning) <\/a><br \/>\n\t\tShop Online: <a href='https:\/\/www.ShopForSoul.com'> https:\/\/www.ShopForSoul.com\/<\/a><br \/>\n\t\tMedium: <a href='https:\/\/medium.com\/@SayedAhmedCanada' target='new' rel=\"noopener\"> https:\/\/medium.com\/@SayedAhmedCanada <\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>doGet() processes HEAD requests in the absence of a doHead() method Not the service() method but the methods that are called by the service method are better candidates for overriding HttpServlet supports GET, POST, DELETE, OPTIONS, and TRACE requests Retrieve a single value for a form parameter named &#8220;username&#8221;: String u = request.getParameter(&#8220;username&#8221;);, String u &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=66302\">Continue reading<\/a><\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1917],"tags":[],"class_list":["post-66302","post","type-post","status-publish","format-standard","hentry","category-fromsitestree-com","item-wrap"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":23216,"url":"http:\/\/bangla.sitestree.com\/?p=23216","url_meta":{"origin":66302,"position":0},"title":"Essential Knowledge on Web Component Development #Root #By Sayed Ahmed","author":"Author-Check- Article-or-Video","date":"March 27, 2021","format":false,"excerpt":"doGet() processes HEAD requests in the absence of a doHead() method Not the service() method but the methods that are called by the service method are better candidates for overriding HttpServlet supports GET, POST, DELETE, OPTIONS, and TRACE requests Retrieve a single value for a form parameter named \"username\": String\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":10170,"url":"http:\/\/bangla.sitestree.com\/?p=10170","url_meta":{"origin":66302,"position":1},"title":"SearchEngines.java Servlet that redirects requests to various search engines. Uses the SearchSpec helper class. Accessed by means of SearchEngines.html.","author":"","date":"August 19, 2015","format":false,"excerpt":"SearchEngines.java\u00a0 Servlet that redirects requests to various search engines. Uses the SearchSpec\u00a0 helper class. Accessed by means of SearchEngines.html. package cwp; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import java.net.*; \/** Servlet that takes a search string, number of results per \u00a0*\u00a0 page, and a search engine name, sending the query\u2026","rel":"","context":"In &quot;Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8&quot;","block_context":{"text":"Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8","link":"http:\/\/bangla.sitestree.com\/?cat=1417"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":26535,"url":"http:\/\/bangla.sitestree.com\/?p=26535","url_meta":{"origin":66302,"position":2},"title":"SearchEngines.java  Servlet that redirects requests to various search engines. Uses the SearchSpec  helper class. Accessed by means of SearchEngines.html. #Programming Code Examples #Java\/J2EE\/J2ME #Servlet","author":"Author-Check- Article-or-Video","date":"April 27, 2021","format":false,"excerpt":"SearchEngines.java Servlet that redirects requests to various search engines. Uses the SearchSpec helper class. Accessed by means of SearchEngines.html. package cwp; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import java.net.*; \/** Servlet that takes a search string, number of results per * page, and a search engine name, sending the query\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":10166,"url":"http:\/\/bangla.sitestree.com\/?p=10166","url_meta":{"origin":66302,"position":3},"title":"ShowRequestHeaders.java Servlet that shows all request headers sent by browser in current request.","author":"","date":"August 17, 2015","format":false,"excerpt":"ShowRequestHeaders.java Servlet that shows all request headers sent by browser in current request. package cwp; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import java.util.*; \/** Shows all the request headers sent on this request. * * Taken from Core Web Programming Java 2 Edition * from Prentice Hall and Sun Microsystems\u2026","rel":"","context":"In &quot;Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8&quot;","block_context":{"text":"Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8","link":"http:\/\/bangla.sitestree.com\/?cat=1417"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":10181,"url":"http:\/\/bangla.sitestree.com\/?p=10181","url_meta":{"origin":66302,"position":4},"title":"ShowSession.java Servlet that uses session tracking to determine if the client is a repeat visitor. Uses the ServletUtilities class to simplify the DOCTYPE and HEAD output.","author":"","date":"August 21, 2015","format":false,"excerpt":"ShowSession.java Servlet that uses session tracking to determine if the client is a repeat visitor. Uses the ServletUtilities class to simplify the DOCTYPE and HEAD output. package cwp; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import java.net.*; import java.util.*; \/** Simple example of session tracking. * * Taken from Core Web\u2026","rel":"","context":"In &quot;Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8&quot;","block_context":{"text":"Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8","link":"http:\/\/bangla.sitestree.com\/?cat=1417"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":26523,"url":"http:\/\/bangla.sitestree.com\/?p=26523","url_meta":{"origin":66302,"position":5},"title":"SimplerHelloWWW.java  Servlet that uses ServletUtilities  to simplify the generation of the DOCTYPE and HEAD part of the servlet. #Programming Code Examples #Java\/J2EE\/J2ME #Servlet","author":"Author-Check- Article-or-Video","date":"April 27, 2021","format":false,"excerpt":"SimplerHelloWWW.java Servlet that uses ServletUtilities to simplify the generation of the DOCTYPE and HEAD part of the servlet. package cwp; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; \/** Simple servlet that generates HTML. This variation of * HelloWWW uses the ServletUtilities utility class * to generate the DOCTYPE, HEAD, and TITLE.\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/66302","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=66302"}],"version-history":[{"count":0,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/66302\/revisions"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=66302"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=66302"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=66302"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}