<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Tutorials To Go</title>
	<atom:link href="http://tootoorials.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://tootoorials.wordpress.com</link>
	<description>Java and Domino tutorials and rants</description>
	<lastBuildDate>Wed, 07 May 2008 13:34:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='tootoorials.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Tutorials To Go</title>
		<link>http://tootoorials.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://tootoorials.wordpress.com/osd.xml" title="Tutorials To Go" />
	<atom:link rel='hub' href='http://tootoorials.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Web Quiz &#8211; Step 3: Finally time for some code</title>
		<link>http://tootoorials.wordpress.com/2008/05/07/web-quiz-step-3-finally-time-for-some-code/</link>
		<comments>http://tootoorials.wordpress.com/2008/05/07/web-quiz-step-3-finally-time-for-some-code/#comments</comments>
		<pubDate>Wed, 07 May 2008 13:33:50 +0000</pubDate>
		<dc:creator>Albin Theander</dc:creator>
				<category><![CDATA[Java EE]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[tomcat]]></category>

		<guid isPermaLink="false">http://tootoorials.wordpress.com/?p=10</guid>
		<description><![CDATA[It&#8217;s time to pull our fingers out of the holster and start coding. Lets plunge straight in and try to figure out what happens later: Start by right clicking the Quiz project and choose to create a new Servlet. Go through the wizard and fill in the following fields (some of them have these values, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tootoorials.wordpress.com&amp;blog=3448782&amp;post=10&amp;subd=tootoorials&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s time to pull our fingers out of the holster and start coding. Lets plunge straight in and try to figure out what happens later:</p>
<ol>
<li>Start by right clicking the Quiz project and choose to create a new Servlet.</li>
<li>Go through the wizard and fill in the following fields (some of them have these values, by default):
<ul>
<li> Project: Quiz</li>
<li> Folder: \Quiz\src</li>
<li> Java Package: quiz</li>
<li> Class name: ShowNextQuestion</li>
<li> Superclass: javax.servlet.http.HttpServlet</li>
<li> Name: ShowQuestion</li>
<li> URL Mappings: /ShowQuestion</li>
</ul>
</li>
<li>Locate the doGet method and add the following code inside of it:</li>
</ol>
<p>PrintWriter out = response.getWriter();<br />
out.println(&#8220;&lt;html&gt;&lt;head&gt;&lt;title&gt;Question&lt;/title&gt;&lt;/head&gt;&#8221;);<br />
out.println(&#8220;&lt;body&gt;&lt;form action=\&#8221;/Quiz/ShowQuestion\&#8221;&gt;&#8221;);<br />
out.println(&#8220;&lt;h1&gt;Question 1&lt;/h1&gt;&lt;p /&gt;&lt;p&gt;&#8221;);<br />
out.println(&#8220;What is a duck?&lt;/p&gt;&#8221;);<br />
out.println(&#8220;&lt;input type=\&#8221;radio\&#8221; value=\&#8221;1\&#8221; name=\&#8221;Answer\&#8221;&gt;A bird&lt;br&gt;&#8221;);<br />
out.println(&#8220;&lt;input type=\&#8221;radio\&#8221; value=\&#8221;2\&#8221; name=\&#8221;Answer\&#8221;&gt;A boat&lt;br&gt;&#8221;);<br />
out.println(&#8220;&lt;input type=\&#8221;radio\&#8221; value=\&#8221;3\&#8221; name=\&#8221;Answer\&#8221;&gt;A tiny, yellow java programmer floating in a tub&lt;br&gt;&#8221;);<br />
out.println(&#8220;&lt;input type=\&#8221;submit\&#8221; value=\&#8221;Ok\&#8221;");<br />
out.println(&#8220;&lt;/form&gt;&lt;/body&gt;&lt;/html&gt;&#8221;);</p>
<p>Save the file and run it on the server. (You can right-click on the file and choose run, or just stand in the editor and press the run button)</p>
<p>If you copied the code meticulously (or figured out how copy and paste works), you will see a web page with the question on it. Selecting a radio button and pressing OK will bring you back to the same page again, with the selected answer in the url.</p>
<p>So what happens here? Well, the browser tries to open &#8220;http://localhost:8080/Quiz/ShowQuestion&#8221;. When we run the servlet, our application is automatically installed on the tomcat server on the path /Quiz/. (In a real environment we would choose the &#8220;base&#8221; path to our application when we installed it.) So the first part (http://localhost:8080/Quiz/) will bring the server to our application. For the next step, we need to take a peek in our web.xml. (It&#8217;s in WebContent/WEB-INF, remember?). There are two entries that together maps the path &#8220;/ShowQuestion&#8221; to our servlet (quiz.ShowQuestion, remember the package name). First look at the servlet mapping:</p>
<p>&lt;servlet-mapping&gt;<br />
&lt;servlet-name&gt;ShowQuestion&lt;/servlet-name&gt;<br />
&lt;url-pattern&gt;/ShowQuestion&lt;/url-pattern&gt;<br />
&lt;/servlet-mapping&gt;</p>
<p>This entry says &#8220;If there is an incoming URL ending on /ShowQuestion, then execute the servlet named ShowQuestion&#8221;. Next, we look at the servlet tag:</p>
<p>&lt;servlet&gt;<br />
&lt;description&gt;&lt;/description&gt;<br />
&lt;display-name&gt;ShowQuestion&lt;/display-name&gt;<br />
&lt;servlet-name&gt;ShowQuestion&lt;/servlet-name&gt;<br />
&lt;servlet-class&gt;quiz.ShowQuestion&lt;/servlet-class&gt;<br />
&lt;/servlet&gt;</p>
<p>This one says &#8220;There is a servlet named ShowQuestion, and the code is in quiz.ShowQuestion.&#8221; The connection between these two entries is the servlet-name tag.</p>
<p>That brings into the servlet code. Depending on which method is used to call the servlet, different methods will be executed. Just opening a page uses GET, resulting in the doGet method being executed. If POST was used, the doPost method would have been called instead. Both these methods have two parameters: an HttpServletRequest and an HttpServletResponse. The Request represents the incoming data, this includes data that is sent to the servlet and which url was used to call it. The Response represents whatever we want to send back to the browser. In this example, we only sent back HTML, but we coule have set different status codes or cookies.</p>
<p>Let&#8217;s finish this lesson with using our new knowledge to check if the correct answer was submitted. First, change the line in doGet which prints the form tag to:</p>
<p>out.println(&#8220;&lt;form action=\&#8221;/Quiz/ShowQuestion\&#8221; method=\&#8221;POST\&#8221;&gt;&#8221;);</p>
<p>This will post the information back to the servlet instead of sending it in the url. It also means that the doPost method will be called instead. Remember that the request parameter represents the incoming data? That&#8217;s where we go digging for the answer. The field on the html form is called Answer, so add the following code to the doPost method:</p>
<pre style="font-size:12px;">
String answer = request.getParameter("Answer");
String sarcasticReaction = null;
if (answer.equals("1")) {
   sarcasticReaction = "Oh, it's a bird? I never would have guessed";
} else if (answer.equals("2")) {
   sarcasticReaction = "A duck-boat, huh? I wished for that when I was 5, too";
} else if (answer.equals("3")) {
   sarcasticReaction = "I didn't ask what &lt;i&gt;You&lt;/i&gt; were.";
}

PrintWriter out = response.getWriter();
out.println("&lt;html&gt;&lt;head&gt;&lt;title&gt;Question&lt;/title&gt;&lt;/head&gt;");
out.println("&lt;body&gt;");
out.println("&lt;h1&gt;Answer&lt;/h1&gt;&lt;p /&gt;&lt;p&gt;");
out.println(sarcasticReaction);
out.println("&lt;/body&gt;&lt;/html&gt;");
</pre>
<p>Note especially the first part where we get the answer from the request and checks it.</p>
<p>Try to run it again. The first time, GET is used, making our doGet to get executed. When the user pressed the Ok button, the browser submitts the answer with POST, triggering our doPost method.</p>
<p>It seems like a whole lot of steps from the moment the user presses ok to the point where the users sees the answer in the browser. But it&#8217;s a real Speedy King. Even with more complex applications, these steps are executed in a jiffy.</p>
<p>Next time, I&#8217;ll tell you why most of the lines of code written here are wrong and should be removed.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/tootoorials.wordpress.com/10/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/tootoorials.wordpress.com/10/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tootoorials.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tootoorials.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tootoorials.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tootoorials.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tootoorials.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tootoorials.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tootoorials.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tootoorials.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tootoorials.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tootoorials.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tootoorials.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tootoorials.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tootoorials.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tootoorials.wordpress.com/10/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tootoorials.wordpress.com&amp;blog=3448782&amp;post=10&amp;subd=tootoorials&amp;ref=&amp;feed=1" width="1" height="1" /><div class="sharedaddy"></div>]]></content:encoded>
			<wfw:commentRss>http://tootoorials.wordpress.com/2008/05/07/web-quiz-step-3-finally-time-for-some-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0c7e97805a4f48085ae95d3f588ccacc?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Albin</media:title>
		</media:content>
	</item>
		<item>
		<title>Web Quiz &#8211; Step 2: Welcome To the Jungle</title>
		<link>http://tootoorials.wordpress.com/2008/04/15/web-quiz-2/</link>
		<comments>http://tootoorials.wordpress.com/2008/04/15/web-quiz-2/#comments</comments>
		<pubDate>Tue, 15 Apr 2008 08:10:18 +0000</pubDate>
		<dc:creator>Albin Theander</dc:creator>
				<category><![CDATA[Java EE]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[tomcat]]></category>

		<guid isPermaLink="false">http://tootoorials.wordpress.com/?p=7</guid>
		<description><![CDATA[Since we have all our tools installed and ready, why not fire them up to run head over heels into the confused world of Java Web development. What is a workspace? An Eclipse Workspace is simply a collection of projects that belong together in some sense. Some people have all the projects in one workspace, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tootoorials.wordpress.com&amp;blog=3448782&amp;post=7&amp;subd=tootoorials&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Since we have all our tools installed and ready, why not fire them up to run <a title="Head over Heels" href="http://www.songtextkomet.de/sites/accept_head-over-heels-1287.htm">head over heels</a> into the confused world of Java Web development.</p>
<div style="border:1px solid black;background:lightgrey none repeat scroll 0 50%;float:right;width:50%;margin-left:5px;">
<p><strong>What is a workspace?</strong></p>
<p>An Eclipse Workspace is simply a collection of projects that belong together in some sense. Some people have all the projects in one workspace, some create a workspace per project, most somewhere in between.</p>
<p>Eclipse have very few global settings for the application itself. Normally, all &#8220;global&#8221; settings are for the workspace. This makes it rather practical to collect projects with the same settings in the same workspace. (All settings can be changed on a per project base, too.)</p>
</div>
<h3>Start Eclipse</h3>
<p>To start Eclipse, open the folder where you unzipped it and double-click the exe file with Eclipse blue ball icon. Being a piece of ultra-configurable software, the first thing that pops up is a question of which workspace you would like to use.  You can choose any path you like, but for this tutorial, I would recommend c:\java\webtutorial.</p>
<p>If this was a new workspace, the first thing to greet you is the welcome page. There are lot of nifty shortcuts to different things, and I have never every used them. Just close the page with the little X on the tab header and you&#8217;re ready to go.</p>
<h3>Create the Quiz Project</h3>
<p>Every single line of code in Eclipse is written inside a project. Let&#8217;s create a nice little Quiz project to have somewhere to play:</p>
<ol>
<li>Choose File-&gt;New Project and select Web/Dynamic Web Project in the dialog. Click Next</li>
<li>Give it the name Quiz.</li>
<li>We have to define where we want to run this baby, but there is nothing in the Target Runtime dropdown. Well, what we don&#8217;t have, we create. (Just a hint of God complex.) Press the New button next to the Target Runtime.</li>
<li>In the box that pops up, find and select Apache Tomcat v6.0 and click Next.</li>
<li>Fill in the path to where you unzipped your Tomcat, and leave the rest with the default values by clicking Finish.</li>
<li>Back in the project dialog, make sure that the configuration is the Default Configuration for Tomcat v6.</li>
<li>There are a lot of other settings to do and you can take the tour and look at them by pressing Next a few times. When you are fed up with looking at things you shouldn&#8217;t change, press Finish to create the project.</li>
</ol>
<h3>What&#8217;s in a project?</h3>
<p>Take a few seconds and look around inside your newly created project. It is shown in a view called the &#8220;Project Explorer&#8221; and it doesn&#8217;t look exactly the same in the file system, but close enough. (If you want a pure file system view, choose Window\Open View and find the Navigator View.)</p>
<ul>
<li><strong>Java Resources: src</strong> &#8211; here we will put our java source code.</li>
<li><strong>build</strong> &#8211; here Eclipse will put everything together. We won&#8217;t touch this at all.</li>
<li><strong>WebContent</strong> &#8211; this folder will contain all of our web pages; HTML, JSP, etc.</li>
<li><strong>WEB-INF</strong> &#8211; contains web resources that we don&#8217;t want to be directly accessible (I&#8217;ll come back to that) and web.xml.</li>
<li><strong>web.xml</strong> &#8211; this file is our Web Description File. It contains information about this web application. We will return to this file several times during this tutorial.</li>
</ul>
<h3>A welcome page</h3>
<p>Every site with self-esteem has a welcome page. We need something to catch the visitor and lure him or her deeper into the jungle of web quizzes. Let&#8217;s make a Hello World page:</p>
<ol>
<li>Right-click on the project and create a new HTML page.</li>
<li>Make sure the WebContent folder is selected in the New HTML Page dialog</li>
<li>Name the file index.html</li>
<li>In the next page you can select among a number of templates. If you&#8217;re a HTML guru, you probably know what to choose here. If not, just go with whatever is default.</li>
<li>After you pressed the Finish button, you can start edit the page.</li>
</ol>
<p>Add some content to the page and save it. Eclipse is no WYSIWYG html editor, but if you try pressing Ctrl-Space in different places in the html code, it will at least help you find tag and attribute names. Normally, it&#8217;s probably easier to create the page in your favorite tool and just save the file here.</p>
<h3>Running the application</h3>
<p>To preview the page, just right-click on it and choose Run/Run on server. (Or, if you&#8217;re still in the editor, press the green little run-triangle in the toolbar.) When Eclipse asks you which server to run it on, choose to create new Tomcat 6.0 server and the press Finish. After a little while a web browser will open inside of Eclipse, showing the content of your page.</p>
<p>If you want to, you can open the same URL from any web browser, to see how it looks.</p>
<h3>Is this the home page?</h3>
<p>In your browser, remove the &#8220;/index.html&#8221; part of the url and see what happens. If everything is working correctly, it should still show the page.</p>
<p>Find and open the web.xml file again. (The <em>web descriptor</em>, remember?) It&#8217;s an XML file, so you can choose between a Design and Source view of the code (the tabs at the bottom of the editor). Whichever way you choose, there is a tag called &lt;welcome-file-list&gt;. Inside this tag is a list of different file names. Whenever you refer to a folder inside our application and not a specific file, tomcat will look for these files (in the order they appear in the xml file) and if it finds one, return that. We were lucky enough (Yeah, right!) to select a filename that was in the list.</p>
<p>Next time, we will try to add some programmatic content. Until then, I expect you to very meticulously create the welcome page of all times. (Or even two pages with links to each other!)</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/tootoorials.wordpress.com/7/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/tootoorials.wordpress.com/7/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tootoorials.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tootoorials.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tootoorials.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tootoorials.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tootoorials.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tootoorials.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tootoorials.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tootoorials.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tootoorials.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tootoorials.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tootoorials.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tootoorials.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tootoorials.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tootoorials.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tootoorials.wordpress.com&amp;blog=3448782&amp;post=7&amp;subd=tootoorials&amp;ref=&amp;feed=1" width="1" height="1" /><div class="sharedaddy"></div>]]></content:encoded>
			<wfw:commentRss>http://tootoorials.wordpress.com/2008/04/15/web-quiz-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0c7e97805a4f48085ae95d3f588ccacc?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Albin</media:title>
		</media:content>
	</item>
		<item>
		<title>Web Quiz &#8211; Step 1: Getting the software</title>
		<link>http://tootoorials.wordpress.com/2008/04/14/web-quiz-1/</link>
		<comments>http://tootoorials.wordpress.com/2008/04/14/web-quiz-1/#comments</comments>
		<pubDate>Mon, 14 Apr 2008 10:42:23 +0000</pubDate>
		<dc:creator>Albin Theander</dc:creator>
				<category><![CDATA[Java EE]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[tomcat]]></category>

		<guid isPermaLink="false">http://tootoorials.wordpress.com/?p=6</guid>
		<description><![CDATA[These directions will be for MS windows (as you will probably deduce from the screen shots.) All the software is available on most other platforms as well, but you&#8217;re on your own with installing and configuring it. We will need the following pieces of software: A Java SDK &#8211; This is needed by Tomcat for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tootoorials.wordpress.com&amp;blog=3448782&amp;post=6&amp;subd=tootoorials&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>These directions will be for MS windows (as you will probably deduce from the screen shots.) All the software is available on most other platforms as well, but you&#8217;re on your own with installing and configuring it.</p>
<p>We will need the following pieces of software:</p>
<ul>
<li>A Java SDK &#8211; This is needed by Tomcat for various reasons</li>
<li>Tomcat &#8211; Our web server</li>
<li>Eclipse &#8211; A better notepad to write our Java code</li>
</ul>
<h3>Java SDK</h3>
<div style="border:1px solid black;float:right;background:lightgrey;width:50%;margin-left:5px;">
<p><strong>Do you already have a Java SDK installed?</strong></p>
<p><strong></strong>You can check if you have one installed already by opening a DOS window and type the following:</p>
<p><code>java -version <em>(should print a version that is 1.5 or 1.6, i.e. 1.6.0_02)</em><br />
javac -version <em>(should print the same version as above)</em></code></p>
</div>
<p>The Java SDK is needed by Tomcat. If you have something older than 1.5, it&#8217;s time to upgrade.</p>
<p>The JDK (the old, but still common, name for the Java SDK) can be downloaded from the <a title="Java SDK download" href="http://java.sun.com/javase/downloads/index.jsp" target="_blank">java download page.</a></p>
<p>Just go with &#8220;JDK 6 update X&#8221; without anything bundled with it.</p>
<p>When the download is done, run the installation. The default values for everything works perfectly.</p>
<p>Most applications in need of Java look for the environment variable JAVA_HOME. It is not set by the installation, unfortunately, so you need to do it yourself like this:</p>
<ol>
<li>Right-click on &#8220;My computer&#8221; and select &#8220;Properties&#8221; from the pop-up menu</li>
<li>Select the &#8220;Advanced&#8221; tab and click the &#8220;Environment Variables&#8221; button close to the bottom.</li>
<li>Scroll through the two lists and check if JAVA_HOME exists already</li>
<li>if it is there, click the &#8220;Modify&#8221; button, otherwise, go with &#8220;New&#8221;</li>
<li>Name the variable JAVA_HOME and let the value be the installation path of the JDK. If you went with the default values, it would probably be something like c:\program files\java\jdk1.6.0_05, depending on which version you downloaded. (NO, this page will not be updated as new versions emerge.)</li>
<li>Just click around on all the OK-buttons until your desktop is back in view.</li>
</ol>
<h3>Tomcat</h3>
<p>Tomcat will take the role of our webserver. Point your browser to  <a title="Tomcat download page" href="http://tomcat.apache.org/download-60.cgi">http://tomcat.apache.org/download-60.cgi</a> and download the Core .zip-file. If you want to set up a Tomcat server to host your site later on, the Windows installer is better, but for development, the zip distribution is the way to go.</p>
<p>When it&#8217;s down, you can unzip it wherever you like. There is no installation, so if you only plan to use it for this tutorial, you can just delete the entire folder afterwards. On my computer, I would unzip it in c:\java. (It will automatically create subfolders.)</p>
<h3>Eclipse</h3>
<p>Eclipse is just as easy to install as Tomcat. Just go to <a title="Eclipse" href="http://www.eclipse.org" target="_blank">www.eclipse.org</a>, click on &#8220;Download Eclipse&#8221; and select the &#8220;Eclipse IDE for Java EE Developers&#8221; and follow the instructions. When the zip file is downloaded, unzip it in a folder of your choice. Again, c:\java is as good a choice as any. (And again, all the files in the zip are in subfolders.)</p>
<h3>Take a break</h3>
<p>Now, when all the software is downloaded and you are on your toes, rearing to go, it is time to relax. So exhale, ask someone to make you <a title="Breakfast in bed" href="http://www.thehighwaystar.com/rosas/lyrics/slaves/slaves05.html">breakfast in bed</a> and soon we&#8217;ll be back to tie the three players together and get the game going.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/tootoorials.wordpress.com/6/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/tootoorials.wordpress.com/6/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tootoorials.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tootoorials.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tootoorials.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tootoorials.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tootoorials.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tootoorials.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tootoorials.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tootoorials.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tootoorials.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tootoorials.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tootoorials.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tootoorials.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tootoorials.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tootoorials.wordpress.com/6/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tootoorials.wordpress.com&amp;blog=3448782&amp;post=6&amp;subd=tootoorials&amp;ref=&amp;feed=1" width="1" height="1" /><div class="sharedaddy"></div>]]></content:encoded>
			<wfw:commentRss>http://tootoorials.wordpress.com/2008/04/14/web-quiz-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0c7e97805a4f48085ae95d3f588ccacc?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Albin</media:title>
		</media:content>
	</item>
		<item>
		<title>Web Quiz – A Java web application</title>
		<link>http://tootoorials.wordpress.com/2008/04/11/web-quiz-0/</link>
		<comments>http://tootoorials.wordpress.com/2008/04/11/web-quiz-0/#comments</comments>
		<pubDate>Fri, 11 Apr 2008 08:27:00 +0000</pubDate>
		<dc:creator>Albin Theander</dc:creator>
				<category><![CDATA[Java EE]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[jsp]]></category>
		<category><![CDATA[servlet]]></category>

		<guid isPermaLink="false">http://tootoorials.wordpress.com/2008/04/11/web-quiz-%e2%80%93-a-java-web-application/</guid>
		<description><![CDATA[The Java Web application I thought we would build is a simple web quiz. The user is presented with a series of questions, one by one, and sees the result after the last question. Tomcat will be used to run the application and Eclipse to develop it. Since I got a question about JDBC, we [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tootoorials.wordpress.com&amp;blog=3448782&amp;post=4&amp;subd=tootoorials&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://tootoorials.files.wordpress.com/2008/04/quiz.jpg"><img class="alignright size-medium wp-image-5" src="http://tootoorials.files.wordpress.com/2008/04/quiz.jpg?w=233&#038;h=300" alt="Let\'s quizzle my dizzle" width="233" height="300" /></a><br />
The Java Web application I thought we would build is a simple web quiz. The user is presented with a series of questions, one by one, and sees the result after the last question.</p>
<p>Tomcat will be used to run the application and Eclipse to develop it. Since I got a question about JDBC, we will use some kind of database for the questions, too. I still haven’t decided on which database to use, but it will be a while until we come that far, anyway.</p>
<p>The plan for now is something along the following lines:</p>
<ol>
<li>Download and install <a href="http://tomcat.apache.org/">Tomcat</a> and <a href="http://www.eclipse.org/">Eclipse</a></li>
<li>Code and run a servlet and a jsp page.</li>
<li>Create a welcome page for the Web Quiz application</li>
<li>Coding your first Web Quiz question</li>
<li>Adding a series of questions</li>
<li>Getting the questions from a database</li>
</ol>
<p>Each of these stages will be described in detail in later posts.</p>
<p>But, as <a href="http://www.thehighwaystar.com/">Deep Purple</a> humbly sings: <a href="http://www.thehighwaystar.com/rosas/lyrics/purpendicular/purpendicular04.html">“The best laid plans come apart at the seams.”</a> Plans are just what you create before you know what to do. They are not meant to be followed. And don’t get me started on a time line&#8230;</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/tootoorials.wordpress.com/4/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/tootoorials.wordpress.com/4/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tootoorials.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tootoorials.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tootoorials.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tootoorials.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tootoorials.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tootoorials.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tootoorials.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tootoorials.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tootoorials.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tootoorials.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tootoorials.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tootoorials.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tootoorials.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tootoorials.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tootoorials.wordpress.com&amp;blog=3448782&amp;post=4&amp;subd=tootoorials&amp;ref=&amp;feed=1" width="1" height="1" /><div class="sharedaddy"></div>]]></content:encoded>
			<wfw:commentRss>http://tootoorials.wordpress.com/2008/04/11/web-quiz-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0c7e97805a4f48085ae95d3f588ccacc?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Albin</media:title>
		</media:content>

		<media:content url="http://tootoorials.files.wordpress.com/2008/04/quiz.jpg" medium="image">
			<media:title type="html">Let\'s quizzle my dizzle</media:title>
		</media:content>
	</item>
		<item>
		<title>Welcome</title>
		<link>http://tootoorials.wordpress.com/2008/04/11/welcome/</link>
		<comments>http://tootoorials.wordpress.com/2008/04/11/welcome/#comments</comments>
		<pubDate>Fri, 11 Apr 2008 07:59:00 +0000</pubDate>
		<dc:creator>Albin Theander</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://tootoorials.wordpress.com/2008/04/11/welcome/</guid>
		<description><![CDATA[Welcome to the Tootoorial blog! I created this blog as a way of sharing some basic knowledge in form of tutorials. Most of them will be groundlickingly basic and meant for all you with some knowledge in programming and a curious mind. My specialties are Java and Lotus Domino development, so if car mechanics is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tootoorials.wordpress.com&amp;blog=3448782&amp;post=3&amp;subd=tootoorials&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Welcome to the Tootoorial blog!</p>
<p>I created this blog as a way of sharing some basic knowledge in form of tutorials. Most of them will be groundlickingly basic and meant for all you with some knowledge in programming and a curious mind.</p>
<p>My specialties are Java and Lotus Domino development, so if car mechanics is what you&#8217;re after, google should be your next stop.</p>
<p>The first tutorial will be about Java Web applications. What software do I need, how do I install it, how do I write the code, and how do I deploy it?</p>
<p>If tutorials are your cup of tea, stay tuned….</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/tootoorials.wordpress.com/3/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/tootoorials.wordpress.com/3/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tootoorials.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tootoorials.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tootoorials.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tootoorials.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tootoorials.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tootoorials.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tootoorials.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tootoorials.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tootoorials.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tootoorials.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tootoorials.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tootoorials.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tootoorials.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tootoorials.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tootoorials.wordpress.com&amp;blog=3448782&amp;post=3&amp;subd=tootoorials&amp;ref=&amp;feed=1" width="1" height="1" /><div class="sharedaddy"></div>]]></content:encoded>
			<wfw:commentRss>http://tootoorials.wordpress.com/2008/04/11/welcome/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0c7e97805a4f48085ae95d3f588ccacc?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Albin</media:title>
		</media:content>
	</item>
	</channel>
</rss>
