<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Java Interview Questions &#187; Servlet Summary</title>
	<atom:link href="http://www.bestjavainterviewquestions.com/category/java-important-notes/servlet-summary/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bestjavainterviewquestions.com</link>
	<description>Java Interview Questions &#124; Core Java Interview Questions &#124; Advanced Java Interview Questions &#124; EJB Interview Questions &#124; J2EE Interview Questions &#124; Hibernate Interview Questions</description>
	<lastBuildDate>Fri, 03 Feb 2012 10:23:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Servlet Summary</title>
		<link>http://www.bestjavainterviewquestions.com/servlet-summary/</link>
		<comments>http://www.bestjavainterviewquestions.com/servlet-summary/#comments</comments>
		<pubDate>Thu, 16 Oct 2008 16:18:45 +0000</pubDate>
		<dc:creator>Ramakrishna</dc:creator>
				<category><![CDATA[Servlet Summary]]></category>

		<guid isPermaLink="false">http://www.bestjavainterviewquestions.com/?p=485</guid>
		<description><![CDATA[&#8211;&#62; A servlet is a Java class that runs on a server, and a servlet for a web application extends the HttpServlet class. &#8211;&#62; When you write servlets , you override the doGet and doPost methods to provide the processing that’s required. These methods receive the request object and the  response object that are passed [...]]]></description>
			<content:encoded><![CDATA[<p><strong>&#8211;&gt; </strong>A servlet is a Java class that runs on a server, and a servlet for a web application extends the HttpServlet class.</p>
<p><strong>&#8211;&gt; </strong>When you write <strong>servlets </strong>, you override the <em>doGet </em>and <em>doPost </em>methods to provide the processing that’s required. These methods receive the request object and the  response object that are passed to them by the server.</p>
<p><strong>&#8211;&gt; </strong>After you use the <em>setContentType </em>method of the response object to set the content type of the response that’s returned to the browser, you use the <em>getWriter </em>method  to create a <em>PrintWriter </em>object. Then, you can use the <em>println </em>and print methods of  that object to send HTML back to the browser.</p>
<p><strong>&#8211;&gt; </strong>The class files for servlets must be stored in the <em>WEB-INF\classes</em> directory of an  application or in a subdirectory that corresponds to a package name.</p>
<p><strong>&#8211;&gt; </strong>To request a servlet from a URL, you include the word “servlet” after the document root directory in the path. This is followed by the package name, a dot, and the servlet name.</p>
<p><strong>&#8211;&gt; </strong>You can override the init method of a servlet to initialize its instance variables. These variables are then available to all of the threads that are spawned for the one instance of the servlet.</p>
<p><strong>&#8211;&gt; </strong>When you code a thread-safe servlet, you prevent two or more users from accessing  the same block of code at the same time.</p>
<p><strong>&#8211;&gt; </strong>To print debugging data to the server console, you can use the println method of  the System.out or System.err object. An alternative is to use the log methods of the  HttpServlet class to write debugging data to a log file.</p>
<h2  class="related_post_title">Random Posts</h2><ul class="related_post"><li>April 5, 2009 -- <a href="http://www.bestjavainterviewquestions.com/how-to-get-a-leap-year/" title="How to get a Leap Year">How to get a Leap Year</a> (0)</li><li>August 24, 2008 -- <a href="http://www.bestjavainterviewquestions.com/define-stored-procedures/" title="Define Stored Procedures">Define Stored Procedures</a> (0)</li><li>April 4, 2009 -- <a href="http://www.bestjavainterviewquestions.com/define-jarwarear-file/" title="Define Jar,War,Ear file">Define Jar,War,Ear file</a> (0)</li><li>July 15, 2008 -- <a href="http://www.bestjavainterviewquestions.com/springs-interview-questions-3/" title="Springs Interview Questions">Springs Interview Questions</a> (1)</li><li>November 6, 2008 -- <a href="http://www.bestjavainterviewquestions.com/collection-framework/" title="Collection FrameWork">Collection FrameWork</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.bestjavainterviewquestions.com/servlet-summary/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

