<?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>Techtracer &#187; SCWCD</title>
	<atom:link href="http://techtracer.com/category/scwcd/feed/" rel="self" type="application/rss+xml" />
	<link>http://techtracer.com</link>
	<description>Tracing the course of Web Technology</description>
	<lastBuildDate>Tue, 06 Jan 2009 12:14:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<image>
  <link>http://techtracer.com</link>
  <url>http://techtracer.com/wp-includes/images/favicon.png</url>
  <title>Techtracer</title>
</image>
		<item>
		<title>SCWCD &#8211; The 3 Steps to Success!</title>
		<link>http://techtracer.com/2007/07/10/scwcd-the-3-steps-to-success/</link>
		<comments>http://techtracer.com/2007/07/10/scwcd-the-3-steps-to-success/#comments</comments>
		<pubDate>Tue, 10 Jul 2007 16:53:40 +0000</pubDate>
		<dc:creator>nitinpai</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Java EE]]></category>
		<category><![CDATA[SCWCD]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://techtracer.com/2007/07/10/scwcd-the-3-steps-to-success/</guid>
		<description><![CDATA[After my completion of SCDJWS I had written about the 3 steps to success in SCDJWS which has helped many who were new in the web services domain to help them get prepared and confident about preparing for the big exam! Following the same foot steps I am now presenting in front of you 3 [...]]]></description>
			<content:encoded><![CDATA[<p>After my completion of <strong>SCDJWS</strong> I had written about the <a href="/category/scdjws/">3 steps to success</a> in <strong>SCDJWS</strong> which has helped many who were new in the web services domain to help them get prepared and confident about preparing for the big exam! Following the same foot steps I am now presenting in front of you <strong>3 steps</strong> to success in <strong>SCWCD</strong>. I scored a <strong>90+</strong> <a href="/2007/07/09/scwcd-mission-accomplished-2/">in the exam</a> and so I take a a pride to provide you the guidance of how to get a <strong>90+ </strong></p>
<p><strong>Why are there always 3 Steps to success?</strong></p>
<p>This probably would be the same doubt on the lines of why do we say &#8220;<em>Ready&#8230;Steady&#8230;Go</em>&#8221; and also the countdown of a start of a timer in &#8220;<em>3..2..1</em>&#8220;. Well, the 3 steps are same everywhere, only their definition changes. Similarly I always make it a point to divide my preparation routine into particularly 3 steps to make it sound quicker and much systematic. Finally, its the enthusiasm that counts that you put in each of the steps.</p>
<p><strong>Stop all that blabber&#8230; How do I go about preparing for SCWCD?</strong></p>
<p>Okay..okay. <a href="http://www.sun.com/training/certification/java/scwcd.xml">SCWCD</a> (exam code &#8211; <strong>CX 310 081</strong>) is aimed particularly for the web developers and it takes into consideration that you must have developed web applications in the past and now want to try out with <strong>JSP/ Servlets</strong>. So there wont be any questions about how and what are the intricacies dealing with what a web application is, but concentrates on how would you build web applications using the web components that <strong>SUN</strong> provides.</p>
<p><u><strong>SCWCD &#8211; The preparation</strong></u></p>
<p>The 3 steps for success in <strong>SCWCD</strong> are: </p>
<p><u><strong>Step 1 </strong><em><strong>- </strong></em><strong>Head First Servlets &amp; JSP<br />
</strong></u></p>
<p style="text-align: center"><img src="http://techtracer.com/wp-content/uploads/2007/07/hfsj.gif" alt="hfsj.gif" /></p>
<p>The <strong>Head First</strong> Series have become a kind of bible series in whatever they have released their books. In case of JSP / Servlets , its remarkable to see how easily the concepts can be grasped from their way of story telling. Some people would find their books very nonsensical with all those cluttered animations and text written like a scratch pad. Even I had felt the same before reading their first chapter. I did not even come to know that I had finished a total of 3 chapters even though I had the intention of reading just one.</p>
<p>You should mark my words &#8220;<em>Every beginner must use the Head First Series to grasp the concepts quickly</em>&#8220;. Ever since I have read this book I have become a fan of the authors! This book would even be handy to pass out of the exam if you were actually acquainted with working of JSP / Servlets. Solve all the questions at the end of each chapter.</p>
<p><em><strong>OR</strong></em></p>
<p><u><strong>Step 1 </strong><em><strong>-</strong></em><strong> SCWCD Exam Study Kit &#8211; Hanumant Deshmukh</strong></u></p>
<p style="text-align: center"><img src="http://techtracer.com/wp-content/uploads/2007/07/scwcd_exam_study_kit.gif" alt="scwcd_exam_study_kit.gif" /></p>
<p>For a beginner in the world of JSP/ Servlets the Head First Series is enough. But for people who have worked for some time in this technology would find the Head First Series a no brainer. Instead I would suggest such people to get a copy of this book. First of all, its a no nonsense book. It goes strictly with the exam topics and covers almost everything that is required to pass out of the exam.</p>
<p>The language is very lucid and is devoid of any jargons. The quizzes at the end of each chapter should be solved only after you have read the entire book since it would be like a revision of all the concepts. I especially liked the<strong> quizlets</strong> in the midst of the chapters which act as brain teasers. It even gives you a quick revision section where in you can just flip through the pages and have a quick briefing of all the important aspects for the exam. It does not have a mock test as HFSJ does at the end of all chapters.</p>
<p><u><strong>Step 2 &#8211; SCWCD Study Companion &#8211; Charles Lyons</strong></u></p>
<p align="center"><img src="http://techtracer.com/wp-content/uploads/2007/07/scwcd_study_companion.gif" alt="scwcd_study_companion.gif" /></p>
<p>SCWCD <strong>cannot</strong> be aimed for a <strong>100%</strong> if you have not referred to the <strong>API documentation</strong> or the <strong>JSP and Servlet Specifications.</strong> But would you really like to go through such humongous documentation within a short span of time? I hear many no&#8217;s cried out loud. But what if I say you would get a compact series of chapters and exam wise listed topics with the API information just perfect for the exam and Specification filtered out with only the exam relevant aspects then this the book to go for. I woudln&#8217;t have been able to score a <strong>90+</strong> score seriously speaking without this book.</p>
<p><a href="http://www.garnerpress.com/catalogue/BK0316"><strong>Charles Lyons</strong></a> has prepared the book with a lot of efforts of perfectly scanning upto the <strong>API level details</strong> and also packaging it with the <strong>specification information</strong> so compactly that you don&#8217;t get bored reading it. He has maintained the flow so accurately that your questions will immediately be answered just as they get raised in your mind. <strong>Don&#8217;t</strong> try to read through the chapters in between because the flow of the chapters will be clear only when you start it from the beginning. I <strong>assure</strong> that reading this book wont make you touch the specifications nor the API documentations at all. Even I didn&#8217;t!</p>
<p>The best part of the book is it acts not only as a SCWCD study companion but also as a <strong>Reference book</strong> for future use since it has additional chapters for the <strong>updates </strong>that have happened in the recent past in JSP and Servlets.</p>
<p>The one thing I would reprimand in using this book is<strong> don&#8217;t</strong> try to solve tests provided at the end of each chapter since they are literally tough! You need to have your brain super charged to solve the tests since they cover an amazing depth of knowledge. But on the lines of SCWCD you <strong>won&#8217;t </strong>get such difficult questions so it is better if you stick to the tests provided in the earlier 2 books.</p>
<p><u><strong>Step 3 &#8211; Test yourself with the JWebPlus Simulator and the HFSJ mock test</strong></u></p>
<p style="text-align: center"><img src="http://techtracer.com/wp-content/uploads/2007/07/jwebplus.gif" alt="jwebplus.gif" /></p>
<p>Finally when you are exhausted with all the reading you would need some time to practice. Till now I have not said about practicing! This is because I believe that it is better if you first understand all the concepts clearly before practicing. So after all your theoretical concepts have been cleared try to practice <strong>on the basis of mock tests</strong>! This is a unique way of clearing your doubts.</p>
<p>The <strong>JWebPlus Simulator</strong> is the <strong>best</strong> simulator, provided by <a href="http://www.enthuware.com/jwebplus/">Enthuware</a>, which perfectly mimics the original exam environment. I haven&#8217;t tried the <strong>Whizlabs</strong> since they don&#8217;t replicate the same sense of depth as the exam provides. They are more tough than the actual exam and I don&#8217;t want anyone to feel disheartened when they get a low WhizLabs score.</p>
<p>After your reading is over try to solve 1 or 2 tests. In each test <strong>note down</strong> which are your strong and weak points. The exam results provide scores topic wise. The strong points dont need to be tried out since you obviously have the knowledge of them. But you definitely need to try out the weak points.</p>
<p>If you ask me I had failed in the first 2 tests and my weak points were mainly tag libraries and EL(Expression Language). But when I realized that I had the theoretical knowledge but did not know about their practical aspects then I tried it out myself and each of the trials clarified my doubts and I felt more confident. I sincerely feel this is a good approach rather than practicing out each and every thing. Some things can be just learnt from the books.</p>
<p>The JWebPlus Simulator has a total of <strong>7 mock tests</strong> and <strong>3 categorical tests</strong> namely &#8211; easy, tough and very tough. By carrying out the step in the fashion as I mentioned I started getting 84% in the later tests and my confidence was sky high.</p>
<p>The ultimate test I would advice you to give is the <strong>HFSJ mock test</strong>. Altough after solving so many tests you don&#8217;t actually have to solve this one, but as the saying goes &#8220;<em>Nothing is impossible</em>&#8221; you should try to solve it out too. The only challenge you would face here is that the multiple choice questions haven&#8217;t been stated as to how many you have to choose. Rather it is mentioned &#8220;<em>Choose all that apply</em>&#8221; which is somewhat irritating. But you should accept it as a challenge and prove yourself that you are an <strong>expert</strong> now! I took the challenge and scored an 81% in the mock test.</p>
<p><u><strong>The battle begins!</strong></u></p>
<p style="text-align: center"><img src="http://techtracer.com/wp-content/uploads/2007/07/scwcd.gif" alt="scwcd.gif" /></p>
<p>So now that your 3 steps have completed, you are armed and ready to conquer the test of the time. The final <strong>SCWCD</strong> (<strong>CX</strong> <strong>310 081</strong> &#8211; remember this!) and the moment of celebration will be just 2 and a half hours far from you! So get armed with these 3 steps in mind and jump the bandwagon of conquerors as I shout out loud &#8220;<em>Ready&#8230;Steady&#8230;Go!</em>&#8220;</p>
<h2>Related posts:</h2><ul><li><a href="http://techtracer.com/2008/01/16/ucertify-scwcd-prepkit-detailed-review/" rel="bookmark" title="Permanent Link: uCertify SCWCD PrepKit &#8211; Detailed Review">uCertify SCWCD PrepKit &#8211; Detailed Review</a></li><li><a href="http://techtracer.com/2007/08/01/j2ee-or-jee-java-5-or-java-15-is-sun-crazy/" rel="bookmark" title="Permanent Link: J2EE or JEE, Java 5 or Java 1.5 &#8211; Is SUN Crazy?">J2EE or JEE, Java 5 or Java 1.5 &#8211; Is SUN Crazy?</a></li><li><a href="http://techtracer.com/2007/07/09/scwcd-mission-accomplished-2/" rel="bookmark" title="Permanent Link: SCWCD &#8211; Mission Accomplished 2">SCWCD &#8211; Mission Accomplished 2</a></li><li><a href="http://techtracer.com/2008/10/06/google-chrome-whats-in-it-for-ya/" rel="bookmark" title="Permanent Link: Google Chrome &#8211; What&#8217;s in it for ya?">Google Chrome &#8211; What&#8217;s in it for ya?</a></li><li><a href="http://techtracer.com/2007/04/09/web-and-desktop-apps-the-3rd-world-war/" rel="bookmark" title="Permanent Link: Web and Desktop Apps &#8211; the 3rd World War!">Web and Desktop Apps &#8211; the 3rd World War!</a></li></ul><br /><a href="http://techtracer.com/">Techtracer.com</a> Copyright &copy; 2008<br /> ]]></content:encoded>
			<wfw:commentRss>http://techtracer.com/2007/07/10/scwcd-the-3-steps-to-success/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>SCWCD &#8211; Mission Accomplished 2</title>
		<link>http://techtracer.com/2007/07/09/scwcd-mission-accomplished-2/</link>
		<comments>http://techtracer.com/2007/07/09/scwcd-mission-accomplished-2/#comments</comments>
		<pubDate>Mon, 09 Jul 2007 16:49:14 +0000</pubDate>
		<dc:creator>nitinpai</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[SCWCD]]></category>

		<guid isPermaLink="false">http://techtracer.com/2007/07/09/scwcd-mission-accomplished-2/</guid>
		<description><![CDATA[Holy Grail !
It was a wonderful day today as the morning proved very good for me. This morning I gave the test of the time after my earlier mission of giving SCDJWS. Sincerely speaking this exam was much more easier than SCDJWS but I feared it more than SCDJWS. The reason being I had the [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Holy Grail</strong> !</p>
<p>It was a wonderful day today as the morning proved very good for me. This morning I gave the test of the time after my earlier <a href="http://2007/01/29/scdjws-mission-accomplished/">mission of giving SCDJWS</a>. Sincerely speaking this exam was much more easier than <strong>SCDJWS</strong> but I feared it more than <strong>SCDJWS</strong>. The reason being I had the access to all the materials one could ever think of. And more to it, this time I was fully prepared and not half confident as my former one.</p>
<p><strong>Endeavor<br />
</strong></p>
<p>I had vouched to give this exam as soon as I had completed my <strong>SCDJWS</strong> certification. This was because I have more liking for working in the web applications domain rather than the business applications to which <strong>SCBCD</strong> caters too. So this exam was to be my third accomplishment after <strong>SCJP, SCDJWS</strong>. This exam was still not tough as thought since it had the same vastness as <strong>SCDJWS</strong> but the main thing which was my advantage was my company library. The library gave me access to all the things I required for the exam and I did not have to spend even a single penny on the materials.</p>
<p><strong>Preparation</strong></p>
<p>I had started to prepare for <strong>SCWCD</strong> from the start of <strong>March, 2007</strong>. So its now almost after 4 months that I gave the exam. But sincerely speaking if you even devote atleast 4 hours a day this exam can be well accomplished within <strong>2 months</strong>. I took 4 months since I had not worked on <strong>JSP / Servlets</strong> nor I am in a project which is of JEE (remember they have changed it from <strong>J2EE </strong>to <strong>JEE</strong>!).</p>
<p><strong>The Venue</strong></p>
<p>I came to the <strong>Thomson Prometric Center</strong> at Marwah House, Saki Naka in <strong>Andheri </strong>at 8:30 AM. The receptionist told me that the test would be made ready by 9:15 AM. The center on entrance looked very plush with elegant style of the building and it was plush inside too! Just as the entered the center, I was at first shocked to see the occasion. Almost 20 people already were seated with forms in their hands. I thought it would be a bad thing to wait for so many people to complete their test.</p>
<p>But I was bought to relief by the receptionist who told me that none of those people were to give Java certification and were there to give <em><strong>GRE, CBT, PMP, CCNA</strong></em> etc. I did the necessary formalities as told and was even reluctant to part away with my wrist watch as he told me that nothing could be taken inside expect my passport and pan card and he did mean nothing! The security was really tight!</p>
<p>Luckily they had provision for storing our valuables in big compartments and happily did I stuff it with my bag, my wallet, my cell phone, my watch and finally my pen too! Can you believe this, they did not allow me to take my lucky pen with me. I thought now I should have made my brain had a little more space to keep temporary things which I could I have written down with my pen! Jesus!</p>
<p>But I was in for a surprise because once as I was advised to enter the examination hall a nice lady accompanied me to her desk. There I had to some more formalities as looking at the lady who stared at me and then kept the passport copy besides my face to make sure as if I was not a terrorist! (Why would a terrorist give SCWCD anyway?).</p>
<p><strong>The Mission</strong></p>
<p>Finally the lady took me another secret chamber where the big thing was awaiting. Fortunately I was not blind folded amidst such amazing security. I was in for more surprises. The lady told me not to even try acting smart. She showed me those cameras lurking all over the exam hall and that all over movements were audio as well as video taped. And If I had any problem I was supposed to just raise my hand without turning my head whatsoever. The lady had this huge monitor which she used to watch the people raising their hand and then would arrive to their help. My God! This was damn fascinating stuff for me. I got a feeling that I was in the Matrix. I hoped there were no laser guns pointing at me if I even had to tilt my head. I was given a erasable plastic pad and a marker for writing down if required. Darn! my lucky pen!</p>
<p>The exam started and my sweating too started simultaneously. This was because I once thought I was sitting in the wrong exam (I remember one fellow from javaranch who sat for the wrong exam which was meant for an upgrade and not the original one. The original exam code is <strong>CX 310 081</strong> and the upgrade is <strong>CX 310 082</strong>) since the first 13 questions were of Tag Libraries!! Later on the regular questions started appearing and I was relieved. I finished my exam an hour earlier and did the review almost twice. I was so confident that I hoped of seeing a 100% on the score card. My heart was pounding!</p>
<p><strong>Accomplished!</strong></p>
<p>I finally submitted the test and came out to get a much awaited score I had got only to see a feedback form being kept in front of me! The lady wanted to know if she was the best in scaring people. But I asked her politely to please at least tell me the score. She told in such an enthusiasm &#8220;<strong>Congrats! You got a 91%</strong>&#8220;, that I thought now I was going to be finally shooted by a gun. But she just wanted to shake hands with me silly!</p>
<p>I was not overjoyed to hear the score because my mind had already made an impression of getting a 100% but then I thought &#8220;Hey, atleast I got a 90+&#8221;. I filled in the feedback form and wished them good luck with that amazing kind of security they had and the staff was also so professional!</p>
<p>I came out all gleaming and all the more happy since I had completed the trilogy &#8211; <strong>SCJP</strong>, <strong>SCWCD</strong>, <strong>SCDJWS</strong>. But hey, my mind was racing ahead of me. It said &#8220;Time now for the part 4 buddy&#8221;. Yes, I thought, I was still to give <strong>SCBCD</strong> for being a complete J2EE certified professional. The show must go on!</p>
<h2>Related posts:</h2><ul><li><a href="http://techtracer.com/2007/07/23/servlet-30-the-journey-begins-now/" rel="bookmark" title="Permanent Link: Servlet 3.0 &#8211; The Journey Begins Now">Servlet 3.0 &#8211; The Journey Begins Now</a></li><li><a href="http://techtracer.com/2007/01/29/scdjws-mission-accomplished/" rel="bookmark" title="Permanent Link: SCDJWS &#8211; mission accomplished">SCDJWS &#8211; mission accomplished</a></li><li><a href="http://techtracer.com/2007/07/10/scwcd-the-3-steps-to-success/" rel="bookmark" title="Permanent Link: SCWCD &#8211; The 3 Steps to Success!">SCWCD &#8211; The 3 Steps to Success!</a></li><li><a href="http://techtracer.com/2008/01/16/ucertify-scwcd-prepkit-detailed-review/" rel="bookmark" title="Permanent Link: uCertify SCWCD PrepKit &#8211; Detailed Review">uCertify SCWCD PrepKit &#8211; Detailed Review</a></li><li><a href="http://techtracer.com/author/" rel="bookmark" title="Permanent Link: Author">Author</a></li></ul><br /><a href="http://techtracer.com/">Techtracer.com</a> Copyright &copy; 2008<br /> ]]></content:encoded>
			<wfw:commentRss>http://techtracer.com/2007/07/09/scwcd-mission-accomplished-2/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Learn the Servlet API &#8211; ServletRequest and HttpServletRequest</title>
		<link>http://techtracer.com/2007/06/22/learn-the-servlet-api-servletrequest-and-httpservletrequest/</link>
		<comments>http://techtracer.com/2007/06/22/learn-the-servlet-api-servletrequest-and-httpservletrequest/#comments</comments>
		<pubDate>Fri, 22 Jun 2007 14:42:01 +0000</pubDate>
		<dc:creator>nitinpai</dc:creator>
				<category><![CDATA[Java EE]]></category>
		<category><![CDATA[SCWCD]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://techtracer.com/2007/06/22/learn-the-servlet-api-servletrequest-and-httpservletrequest/</guid>
		<description><![CDATA[We will now concentrate on the basic aspect of using a Servlet which is requests and response. But we will currentlyÂ concentrate only on ServletRequest and HttpServletRequest.
Points to Ponder:Â 

ServletRequest is not in any way responsible for fetching HTTP related properties.
ServletRequest and HttpServletRequestÂ both are interfaces and you cannot directly use them.
The interface implementations depend on the vendor [...]]]></description>
			<content:encoded><![CDATA[<p>We will now concentrate on the basic aspect of using a Servlet which is requests and response. But we will currentlyÂ concentrate only on <em>ServletRequest</em> and <em>HttpServletRequest.</em></p>
<p><strong><u>Points to Ponder:</u></strong><em>Â </em></p>
<ul>
<li><em>ServletRequest</em> is not in any way responsible for fetching <strong>HTTP</strong> related properties.</li>
<li><em>ServletRequest </em>and<em> HttpServletRequestÂ </em>both are interfaces and you cannot directly use them.</li>
<li>The interface implementations depend on the vendor and not on the developer.</li>
</ul>
<p><strong><u>ServletRequest</u></strong>Â </p>
<p>Lets look at the methods present in the <em>ServletRequest</em> Interface first and categorize them. There are in total <strong>29 methods</strong>. For making the categories first we would have to look as to what are things to carry out when we receive a request. The things we would like to do are:</p>
<p><strong>1.</strong> Â Read the parameters obtained from the form input.</p>

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;"><span style="color: #003399; font-weight: bold;">Enumeration</span>  getParameterNames<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
&nbsp;
<span style="color: #003399; font-weight: bold;">String</span>  getParameter<span style="color: #009900;">&#40;</span> <span style="color: #003399; font-weight: bold;">String</span> name <span style="color: #009900;">&#41;</span>
&nbsp;
<span style="color: #003399; font-weight: bold;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span>  getParameterValues<span style="color: #009900;">&#40;</span> <span style="color: #003399; font-weight: bold;">String</span> name <span style="color: #009900;">&#41;</span>
&nbsp;
<span style="color: #003399; font-weight: bold;">Map</span>  getParameterMap<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p><strong>2.</strong> For logging purpose, inquire who sent the request and through which protocol,etc.</p>

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;"><span style="color: #003399; font-weight: bold;">String</span>  getRemoteAddr<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
&nbsp;
<span style="color: #003399; font-weight: bold;">String</span>  getRemoteHost<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> 
&nbsp;
<span style="color: #003399; font-weight: bold;">String</span>  getProtocol<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> 
&nbsp;
<span style="color: #003399; font-weight: bold;">String</span>  getScheme<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> 
&nbsp;
<span style="color: #003399; font-weight: bold;">String</span>  getRealPath<span style="color: #009900;">&#40;</span> <span style="color: #003399; font-weight: bold;">String</span> path <span style="color: #009900;">&#41;</span> 
&nbsp;
<span style="color: #006600; font-weight: bold;">int</span>  getRemotePort<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p><strong>3.</strong> Perform a check on Attributes which might be lying around or maybe do a cleanup.</p>

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;"><span style="color: #003399; font-weight: bold;">Enumeration</span>  getAttributeNames<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
&nbsp;
<span style="color: #006600; font-weight: bold;">void</span>  setAttribute<span style="color: #009900;">&#40;</span> <span style="color: #003399; font-weight: bold;">String</span> name, <span style="color: #003399; font-weight: bold;">Object</span> o <span style="color: #009900;">&#41;</span> 
&nbsp;
<span style="color: #003399; font-weight: bold;">Object</span>  getAttribute<span style="color: #009900;">&#40;</span> <span style="color: #003399; font-weight: bold;">String</span> name <span style="color: #009900;">&#41;</span> 
&nbsp;
<span style="color: #006600; font-weight: bold;">void</span>  removeAttribute<span style="color: #009900;">&#40;</span> <span style="color: #003399; font-weight: bold;">String</span> name <span style="color: #009900;">&#41;</span></pre></div></div>

<p><strong>4.</strong> Read some user preferences</p>

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;"><span style="color: #003399; font-weight: bold;">Locale</span>  getLocale<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
&nbsp;
<span style="color: #003399; font-weight: bold;">Enumeration</span>  getLocales<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> 
&nbsp;
<span style="color: #003399; font-weight: bold;">String</span>  getCharacterEncoding<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> 
&nbsp;
<span style="color: #003399; font-weight: bold;">String</span>  getContentType<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> 
&nbsp;
<span style="color: #006600; font-weight: bold;">int</span>  getContentLength<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p><strong>5.</strong> Inquire about where your own servlet. This is only required in for logging purposes as to which servlet might modify your business objects which can be then used while debugging.</p>

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;"><span style="color: #003399; font-weight: bold;">String</span>  getServerName<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
&nbsp;
<span style="color: #006600; font-weight: bold;">int</span>  getServerPort<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> 
&nbsp;
<span style="color: #006600; font-weight: bold;">int</span>  getLocalPort<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> 
&nbsp;
<span style="color: #003399; font-weight: bold;">String</span>  getLocalAddr<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> 
&nbsp;
<span style="color: #003399; font-weight: bold;">String</span>  getLocalName<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p><strong>6.</strong> Get someÂ input sourcesÂ if you want yourself parse throught the request information. Remember both these throw an <em>IOException.</em></p>

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;">ServletInputStream  getInputStream<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> java.<span style="color: #006633;">io</span>.<span style="color: #003399; font-weight: bold;">IOException</span>
&nbsp;
<span style="color: #003399; font-weight: bold;">BufferedReader</span>  getReader<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> java.<span style="color: #006633;">io</span>.<span style="color: #003399; font-weight: bold;">IOException</span></pre></div></div>

<p><strong>7.</strong> Get a <strong>dispatcher</strong> for including or forwarding the request. This is a single method.</p>

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;">RequestDispatcher  getRequestDispatcher<span style="color: #009900;">&#40;</span> <span style="color: #003399; font-weight: bold;">String</span> path <span style="color: #009900;">&#41;</span></pre></div></div>

<p><strong>8.</strong> Some other non important functions</p>

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;"><span style="color: #006600; font-weight: bold;">boolean</span>  isSecure<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
&nbsp;
<span style="color: #006600; font-weight: bold;">void</span>  setCharacterEncoding<span style="color: #009900;">&#40;</span> <span style="color: #003399; font-weight: bold;">String</span> env <span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> java.<span style="color: #006633;">io</span>.<span style="color: #003399; font-weight: bold;">UnsupportedEncodingException</span></pre></div></div>

<p><strong><u>HttpServletRequest</u></strong>Â </p>
<p>Now lets take a look at the <em>HttpServletRequest</em> interface which implements the <em>ServletRequest</em>.</p>
<p>There are four fields</p>

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;"><span style="color: #003399; font-weight: bold;">String</span>  BASIC_AUTH
&nbsp;
<span style="color: #003399; font-weight: bold;">String</span>  CLIENT_CERT_AUTH 
&nbsp;
<span style="color: #003399; font-weight: bold;">String</span>  DIGEST_AUTH 
&nbsp;
<span style="color: #003399; font-weight: bold;">String</span>  FORM_AUTH</pre></div></div>

<p><strong>1. </strong>Getting Header Information. Remember in this that, the <em>getDateHeader(String name)</em> returns a long rather than a <em>java.util.Date</em></p>

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;"><span style="color: #006600; font-weight: bold;">long</span>  getDateHeader<span style="color: #009900;">&#40;</span> <span style="color: #003399; font-weight: bold;">String</span> name <span style="color: #009900;">&#41;</span>
&nbsp;
<span style="color: #003399; font-weight: bold;">String</span>  getHeader<span style="color: #009900;">&#40;</span> <span style="color: #003399; font-weight: bold;">String</span> name <span style="color: #009900;">&#41;</span> 
&nbsp;
<span style="color: #003399; font-weight: bold;">Enumeration</span>  getHeaderNames<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> 
&nbsp;
<span style="color: #003399; font-weight: bold;">Enumeration</span>  getHeaders<span style="color: #009900;">&#40;</span> <span style="color: #003399; font-weight: bold;">String</span> name <span style="color: #009900;">&#41;</span> 
&nbsp;
<span style="color: #006600; font-weight: bold;">int</span>  getIntHeader<span style="color: #009900;">&#40;</span> <span style="color: #003399; font-weight: bold;">String</span> name <span style="color: #009900;">&#41;</span></pre></div></div>

<p><strong>2. </strong>You can request the HTTP specific information like URL etc. The main difference between the <em>ServletRequest</em> and <em>HttpServletRequest</em> interfaces is that the path information is more specific to the <strong>URL/URI</strong> and <strong>querystring</strong>, etc in <em>HttpServletRequest </em>as compared to the <strong>server</strong> and <strong>ports</strong> in <em>ServletRequest</em>.</p>

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;"><span style="color: #003399; font-weight: bold;">String</span>  getMethod<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
&nbsp;
<span style="color: #003399; font-weight: bold;">String</span>  getPathInfo<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> 
&nbsp;
<span style="color: #003399; font-weight: bold;">String</span>  getQueryString<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> 
&nbsp;
<span style="color: #003399; font-weight: bold;">String</span>  getRemoteUser<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> 
&nbsp;
<span style="color: #003399; font-weight: bold;">String</span>  getRequestURI<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> 
&nbsp;
<span style="color: #003399; font-weight: bold;">StringBuffer</span>  getRequestURL<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> 
&nbsp;
<span style="color: #003399; font-weight: bold;">String</span>  getServletPath<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> 
&nbsp;
<span style="color: #003399; font-weight: bold;">String</span>  getContextPath<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p><strong>3. </strong>You can create a <strong>session</strong> from within the request object. The <em>getSession()</em> method will always return a <em>HttpSession</em> object.</p>

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;">HttpSession  getSession<span style="color: #009900;">&#40;</span> <span style="color: #006600; font-weight: bold;">boolean</span> create <span style="color: #009900;">&#41;</span>
&nbsp;
HttpSession  getSession<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p><strong>4. </strong>You can get the <strong>cookie </strong>information throught the <em>getCookies()</em> method. But you will <strong>not</strong> be able to get a single cookie. Instead the method will return an <strong>array</strong> of all associated cookies and then you would have to loop through each.</p>

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;">Cookie<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span>  getCookies<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p><strong>5. </strong>There are some convineance methods which are used to find if the user client supports cookies or not.</p>

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;"><span style="color: #003399; font-weight: bold;">String</span>  getRequestedSessionId<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
&nbsp;
<span style="color: #006600; font-weight: bold;">boolean</span>  isRequestedSessionIdFromCookie<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> 
&nbsp;
<span style="color: #006600; font-weight: bold;">boolean</span>  isRequestedSessionIdFromURL<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> 
&nbsp;
<span style="color: #006600; font-weight: bold;">boolean</span>  isRequestedSessionIdFromUrl<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> 
&nbsp;
<span style="color: #006600; font-weight: bold;">boolean</span>  isRequestedSessionIdValid<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p><strong>6. </strong>You can authorize the user with 3 methods provided for security within the request object.</p>

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;"><span style="color: #003399; font-weight: bold;">String</span>  getAuthType<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
&nbsp;
<span style="color: #006600; font-weight: bold;">boolean</span>  isUserInRole<span style="color: #009900;">&#40;</span> <span style="color: #003399; font-weight: bold;">String</span> role <span style="color: #009900;">&#41;</span> 
&nbsp;
<span style="color: #003399; font-weight: bold;">Principal</span>  getUserPrincipal<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p><strong><u>Coming Up:</u></strong><br />
<em>ServletResponse</em> and <em>HttpServletResponse</em></p>
<h2>Related posts:</h2><ul><li><a href="http://techtracer.com/2007/06/21/learn-the-servlet-api-a-step-by-step-approach/" rel="bookmark" title="Permanent Link: Learn the Servlet API &#8211; A step by step approach">Learn the Servlet API &#8211; A step by step approach</a></li><li><a href="http://techtracer.com/2007/07/23/servlet-30-the-journey-begins-now/" rel="bookmark" title="Permanent Link: Servlet 3.0 &#8211; The Journey Begins Now">Servlet 3.0 &#8211; The Journey Begins Now</a></li><li><a href="http://techtracer.com/2007/06/03/the-struts-framework-why-choose-it/" rel="bookmark" title="Permanent Link: The Struts Framework &#8211; Why choose it?">The Struts Framework &#8211; Why choose it?</a></li><li><a href="http://techtracer.com/2007/08/13/java-ee-exhaustive-yet-enchanting/" rel="bookmark" title="Permanent Link: Java EE &#8211; Exhaustive yet Enchanting">Java EE &#8211; Exhaustive yet Enchanting</a></li><li><a href="http://techtracer.com/2007/03/15/scdjws-preparation-a-kick-start-guide/" rel="bookmark" title="Permanent Link: SCDJWS preparation &#8211; a kick start guide">SCDJWS preparation &#8211; a kick start guide</a></li></ul><br /><a href="http://techtracer.com/">Techtracer.com</a> Copyright &copy; 2008<br /> ]]></content:encoded>
			<wfw:commentRss>http://techtracer.com/2007/06/22/learn-the-servlet-api-servletrequest-and-httpservletrequest/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Learn the Servlet API &#8211; A step by step approach</title>
		<link>http://techtracer.com/2007/06/21/learn-the-servlet-api-a-step-by-step-approach/</link>
		<comments>http://techtracer.com/2007/06/21/learn-the-servlet-api-a-step-by-step-approach/#comments</comments>
		<pubDate>Thu, 21 Jun 2007 04:48:33 +0000</pubDate>
		<dc:creator>nitinpai</dc:creator>
				<category><![CDATA[Java EE]]></category>
		<category><![CDATA[SCWCD]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://techtracer.com/2007/01/21/learn-the-servlet-api-a-step-by-step-approach/</guid>
		<description><![CDATA[The SCWCD(Sun Certified Web Component Developer) exam concentrates on the Servlet API version 2.4.Â  In order to prepare for the exam its a necessary step to consider to learn the API itself. Learning the API means getting a knowledge about which Interfaces and which Classes exists. Their inheritance relationships and the methods associated with them. [...]]]></description>
			<content:encoded><![CDATA[<p>The <strong>SCWCD</strong>(Sun Certified Web Component Developer) exam concentrates on the <strong>Servlet API version 2.4</strong>.Â  In order to prepare for the exam its a necessary step to consider to learn the API itself. Learning the API means getting a knowledge about which Interfaces and which Classes exists. Their inheritance relationships and the methods associated with them. This actually helps a person in getting more confident while preparing for the exam since knowledge of the API makes it easy to recognize the errors and exceptions which may occur while using any of the interfaces or classes. It also helps to track the usage of syntaxes when codes are mentioned in the exam and how do they work.</p>
<p>So its in my mind toÂ put forwardÂ the API in depth but not make it boring to read (Has anyone ever considered to read the API docs?). So the plan is to learn it in a stepÂ by step approach taking into mind the exam related topics!</p>
<p>So here we go.</p>
<p>First of all the important classes / interfaces you need to know are the most basic type i.e of the<strong> Servlet</strong>. You have the first basic 3 classes.</p>
<ol>
<li><strong>Servlet</strong> &#8211; interface</li>
<li><strong>GenericServlet</strong> &#8211; abstract class</li>
<li><strong>HttpServlet</strong> -Â abstract class</li>
</ol>
<p><strong><u>Servlet &#8211; <em>Interface</em></u></strong></p>
<p>It has the following methods:</p>

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;"><span style="color: #006600; font-weight: bold;">void</span> init<span style="color: #009900;">&#40;</span> ServletConfig config <span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> ServletException    
&nbsp;
ServletConfig getServletConfig<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>      
&nbsp;
<span style="color: #006600; font-weight: bold;">void</span> service<span style="color: #009900;">&#40;</span> ServletRequest req, ServletResponse res <span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> ServletException, <span style="color: #003399; font-weight: bold;">IOException</span>      
&nbsp;
<span style="color: #003399; font-weight: bold;">String</span> getServletInfo<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>      
&nbsp;
<span style="color: #006600; font-weight: bold;">void</span> destroy<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span></pre></div></div>

<ul>
<li>The Servlet Interface consists of 5 methods out of which only 2 methods throw exceptions including the main method which is &#8220;service&#8221; which has to deal with IO.</li>
<li>Â So it throws an <strong>IOException</strong> alongwith a <strong>ServletException.Â </strong></li>
<li>Note that destroy does not throw any exception since its job is to just free the memory and it does not effect the usage of the servlet in any way since <strong>destroy()</strong> is called when the servlet is not used anymore.</li>
</ul>
<p><strong><u>GenericServlet &#8211; Abstract Class</u></strong></p>
<p>It implements the <strong>Servlet</strong> interface. It has 12 methods.Â Instead of remembering them all, let&#8217;s try to group the important ones into categories.</p>
<p>Since this class implements the <strong>Servlet</strong> interface, it must implement the methods</p>

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;"><span style="color: #006600; font-weight: bold;">void</span> init<span style="color: #009900;">&#40;</span> ServletConfig config <span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> ServletException      
&nbsp;
ServletConfig getServletConfig<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>      
 <span style="color: #000000; font-weight: bold;">abstract</span> <span style="color: #006600; font-weight: bold;">void</span> service<span style="color: #009900;">&#40;</span> ServletRequest req, ServletResponse res <span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> ServletException, <span style="color: #003399; font-weight: bold;">IOException</span>      
&nbsp;
<span style="color: #003399; font-weight: bold;">String</span> getServletInfo<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>      
&nbsp;
<span style="color: #006600; font-weight: bold;">void</span> destroy<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p>It gives you 5 convineance methods for providing more functionality to your servlet. The Servlet interface is only a lifecycle manager. So you basically will have <strong>init(), service() and destroy().</strong> But <strong>GenericServlet </strong>is a more a extension to the lifecycle events. It helps a servlet to access the configuration parameters from the<strong> web.xml</strong>. Hence we have these methods:</p>

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399; font-weight: bold;">String</span> getServletName <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#41;</span>      
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399; font-weight: bold;">String</span> getInitParameter <span style="color: #009900;">&#40;</span> <span style="color: #003399; font-weight: bold;">String</span> name <span style="color: #009900;">&#41;</span>      
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399; font-weight: bold;">Enumeration</span> getInitParameterNames <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#41;</span>      
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> ServletContext getServletContext <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#41;</span></pre></div></div>

<p><strong>GenericServlet</strong> also helps the servlet developer to do some tasks which are required just for some custom requirements. This includes some aspects like checking for a database connection before the servlet is instantiated so that the servlet gets created only when the connection is made. So you have your own method <strong>init()</strong> in this class which is called after the lifecycle event <strong>init(ServletConfig cfg)</strong> of the Servlet interface. Besides this, you have logging methods which are a necessity of any application.</p>

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;"><span style="color: #006600; font-weight: bold;">void</span>  init<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> 
<span style="color: #006600; font-weight: bold;">void</span>  log<span style="color: #009900;">&#40;</span> <span style="color: #003399; font-weight: bold;">String</span> msg <span style="color: #009900;">&#41;</span> 
<span style="color: #006600; font-weight: bold;">void</span>  log<span style="color: #009900;">&#40;</span> <span style="color: #003399; font-weight: bold;">String</span> message, <span style="color: #003399; font-weight: bold;">Throwable</span> t <span style="color: #009900;">&#41;</span></pre></div></div>

<p><strong><em>Important :</em></strong> You must override the<strong> service</strong>() method in order to make a GenericServlet subclass since it is declared <strong>abstract</strong>. The rest methods have default implementations.</p>
<p><strong><u>HttpServlet -Â Abstract class</u></strong></p>
<p>This class extends the <strong>GenericServlet</strong> abstract class and Â implements <strong>Serializable</strong> class. This is needed if you are making servlets for web application. It has methods which strictly follow the <strong>HTTP</strong> protocol. It has its own 9 methods besides the inherited methods and all the doXXX() methods are protected.</p>
<p>The methods which correspond to the HTTP protocol are:</p>

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #006600; font-weight: bold;">void</span>  doGet<span style="color: #009900;">&#40;</span> HttpServletRequest req, HttpServletResponse resp <span style="color: #009900;">&#41;</span>      
&nbsp;
<span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #006600; font-weight: bold;">void</span>  doPost<span style="color: #009900;">&#40;</span> HttpServletRequest req, HttpServletResponse resp <span style="color: #009900;">&#41;</span></pre></div></div>

<p>Other methods rarely used are:</p>

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #006600; font-weight: bold;">void</span>  doDelete<span style="color: #009900;">&#40;</span> HttpServletRequest req, HttpServletResponse resp <span style="color: #009900;">&#41;</span>      
&nbsp;
<span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #006600; font-weight: bold;">void</span>  doHead<span style="color: #009900;">&#40;</span> HttpServletRequest req, HttpServletResponse resp <span style="color: #009900;">&#41;</span>      
&nbsp;
<span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #006600; font-weight: bold;">void</span>  doOptions<span style="color: #009900;">&#40;</span> HttpServletRequest req, HttpServletResponse resp <span style="color: #009900;">&#41;</span>      
&nbsp;
<span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #006600; font-weight: bold;">void</span>  doPut<span style="color: #009900;">&#40;</span> HttpServletRequest req, HttpServletResponse resp <span style="color: #009900;">&#41;</span>      
&nbsp;
<span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #006600; font-weight: bold;">void</span>  doTrace<span style="color: #009900;">&#40;</span> HttpServletRequest req, HttpServletResponse resp <span style="color: #009900;">&#41;</span></pre></div></div>

<ul>
<li>It has a<strong> service()</strong> method too.</li>
<li>This method should not be implemented since it internally sees the type of HTTP request and delegates the request processing to one of the doXXX() methods.</li>
<li>If you override this method, then you yourself will have to do the tasks of delegation.</li>
<li>All the doXXX() and service() method accept two input parameters which are <strong>HttpServletRequest </strong>and <strong>HttpServletResponse</strong>.</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #006600; font-weight: bold;">void</span>  service<span style="color: #009900;">&#40;</span> HttpServletRequest req, HttpServletResponse resp <span style="color: #009900;">&#41;</span>      
&nbsp;
<span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #006600; font-weight: bold;">long</span>  getLastModified<span style="color: #009900;">&#40;</span> HttpServletRequest req <span style="color: #009900;">&#41;</span></pre></div></div>

<p><strong>Coming up:</strong><br />
<em>ServletRequest and HttpServletRequest</em></p>
<h2>Related posts:</h2><ul><li><a href="http://techtracer.com/2007/03/15/scdjws-preparation-a-kick-start-guide/" rel="bookmark" title="Permanent Link: SCDJWS preparation &#8211; a kick start guide">SCDJWS preparation &#8211; a kick start guide</a></li><li><a href="http://techtracer.com/2007/07/23/servlet-30-the-journey-begins-now/" rel="bookmark" title="Permanent Link: Servlet 3.0 &#8211; The Journey Begins Now">Servlet 3.0 &#8211; The Journey Begins Now</a></li><li><a href="http://techtracer.com/2007/06/22/learn-the-servlet-api-servletrequest-and-httpservletrequest/" rel="bookmark" title="Permanent Link: Learn the Servlet API &#8211; ServletRequest and HttpServletRequest">Learn the Servlet API &#8211; ServletRequest and HttpServletRequest</a></li><li><a href="http://techtracer.com/2007/07/10/scwcd-the-3-steps-to-success/" rel="bookmark" title="Permanent Link: SCWCD &#8211; The 3 Steps to Success!">SCWCD &#8211; The 3 Steps to Success!</a></li><li><a href="http://techtracer.com/2007/04/16/the-great-ant-tutorial-a-great-jump-start/" rel="bookmark" title="Permanent Link: The Great Ant Tutorial &#8211; a great jump start">The Great Ant Tutorial &#8211; a great jump start</a></li></ul><br /><a href="http://techtracer.com/">Techtracer.com</a> Copyright &copy; 2008<br /> ]]></content:encoded>
			<wfw:commentRss>http://techtracer.com/2007/06/21/learn-the-servlet-api-a-step-by-step-approach/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
