<?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>mgBlog &#187; Google</title>
	<atom:link href="http://mgsimon.de/tag/google/feed/" rel="self" type="application/rss+xml" />
	<link>http://mgsimon.de</link>
	<description>Esc(ape), einfach ein anderes Blog über technische Spielerei ...</description>
	<lastBuildDate>Sun, 18 Dec 2011 08:52:23 +0000</lastBuildDate>
	<language>de</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Google App Engine und JSON, AboutMyRequest ein Beispiel</title>
		<link>http://mgsimon.de/2011/10/30/google-app-engine-und-json-aboutmyrequest-ein-beispiel/</link>
		<comments>http://mgsimon.de/2011/10/30/google-app-engine-und-json-aboutmyrequest-ein-beispiel/#comments</comments>
		<pubDate>Sun, 30 Oct 2011 14:37:54 +0000</pubDate>
		<dc:creator>mg</dc:creator>
				<category><![CDATA[Hosting]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[App]]></category>
		<category><![CDATA[Engine]]></category>
		<category><![CDATA[GAE]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[Servlet]]></category>

		<guid isPermaLink="false">http://mgsimon.de/?p=3131</guid>
		<description><![CDATA[Die JavaScript Object Notation (JSON) ist ein leicht lesbares und leichtgewichtiges Protokoll, um Daten strukturiert mit wenigen Regeln verwalten zu k&#246;nnen. Viele Wege f&#252;hren nach JSON, hier ein kleines Beispiel in Java &#8230; AboutMyRequest &#8230; &#8230; oder einfach &#252;ber mein Request soll als kleines Beispiel die Informationen &#252;ber eine Anfrage zur Anwendung in der Google [...]]]></description>
			<content:encoded><![CDATA[<p>Die <a href="http://json.org/" target="_blank">JavaScript Object Notation (JSON)</a> ist ein leicht lesbares und leichtgewichtiges Protokoll, um Daten strukturiert mit wenigen Regeln verwalten zu k&#246;nnen.<br />
<div id="attachment_3262" class="wp-caption alignnone" style="width: 452px"><img src="http://mgsimon.de/wp-content/uploads/2011/10/GoogleAppEngineJSONAboutMyRequest.png" alt="Google App Engine JSON :: AboutMyRequest" title="Google App Engine JSON :: AboutMyRequest" width="442" height="228" class="size-full wp-image-3262 stamp" /><p class="wp-caption-text">Google App Engine JSON :: AboutMyRequest</p></div></p>
<p>Viele Wege f&#252;hren nach JSON, hier ein kleines Beispiel in Java &#8230;</p>
<p><span id="more-3131"></span><div style="background-color: rgb(191, 228, 255); border:1px solid rgb(128, 201, 255); color: rgb(0, 0, 0); margin:0 0 1.5em; overflow:auto; padding: 3px;">
<img src="/wp-content/plugins/MyShortCodes/info.png" alt="Hinweis" title="Hinweis" width="24" height="24" style="margin: 4px 8px 0 0; float:left;"/>Das folgende Beispiel wurde unter Mac OS X 10.6.8 mit der Java Version 1.6.0_26, Eclipse EE 3.7.1 Indigo und Google Plugin f&#252;r Eclipse 2.4.1 durchgef&#252;hrt. Siehe auch <a href="http://mgsimon.de/2011/10/25/hello-world-google-app-engine/" title="Hello World Google App Engine">Hello World Google App Engine</a> &#8230;</div></p>
<p><strong>AboutMyRequest &#8230;</strong></p>
<p>&#8230; oder einfach &#252;ber mein Request soll als kleines Beispiel die Informationen &#252;ber eine Anfrage zur Anwendung in der Google App Engine in JSON zur&#252;ck beantworten.</p>
<p><strong>JSON Referenzimplementierung</strong></p>
<p>Im SDK von der Google App Engine sind die Klassen der Referenzimplementierung zur Verarbeitung von JSON im Paket  com.google.appengine.repackaged.org.json (appengine-api-labs-1.5.4.jar) vorhanden.</p>
<div style="background-color: rgb(191, 255, 191); border:1px solid rgb(128, 255, 128); color: rgb(0, 0, 0); margin:0 0 1.5em; overflow:auto; padding: 3px;">
<img src="/wp-content/plugins/MyShortCodes/tip.png" alt="Tipp" title="Tipp" width="24" height="24" style="margin: 4px 8px 0 0; float:left;" />Damit die Dokumenation der Referenzimplementierung von Douglas Crockford in Eclipse verwendet werden kann, k&#246;nnen die Quellen unter <a href="https://github.com/douglascrockford/JSON-java" target="_blank">JSON-java</a> als ZIP-Archiv heruntergeladen werden und dem Projekt hinzugef&#252;gt werden.</div>
<p><strong>AboutMyRequestServlet</strong></p>
<p>Ein neues Servlet wird im Google App Engine Projekt bei selektiertem Package &#252;ber &#8220;File / New / Class&#8221; mit folgenden Einstellungen erstellt.<br />
<div id="attachment_3271" class="wp-caption alignnone" style="width: 452px"><img src="http://mgsimon.de/wp-content/uploads/2011/10/GoogleAppEngineJSONEclipseNewJavaClass.png" alt="Google App Engine JSON :: Eclipse New Java Class" title="Google App Engine JSON :: Eclipse New Java Class" width="442" height="528" class="size-full wp-image-3271 stamp" /><p class="wp-caption-text">Google App Engine JSON :: Eclipse New Java Class</p></div></p>
<ul>
<li>Name: AboutMyRequestServlet</li>
<li>Superclass: javax.servlet.http.HttpServlet</li>
</ul>
<p>In dem folgenden Servlet wird ein JSONObject erzeugt (Zeile 20) und die jeweiligen Header-Informationen hinzugef&#252;gt (Zeile 25). Das JSONObject wird mit dem richtigen Media Type (Zeile 27) &#252;ber Response einfach zum Client gesendet (Zeile 28).</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">tld.sld.my.example</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.IOException</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.Enumeration</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.servlet.ServletException</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.servlet.http.HttpServlet</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.servlet.http.HttpServletRequest</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.servlet.http.HttpServletResponse</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.google.appengine.repackaged.org.json.JSONException</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.google.appengine.repackaged.org.json.JSONObject</span><span style="color: #339933;">;</span>
&nbsp;
@SuppressWarnings<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;serial&quot;</span><span style="color: #009900;">&#41;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> AboutMyRequestServlet <span style="color: #000000; font-weight: bold;">extends</span> HttpServlet <span style="color: #009900;">&#123;</span>
&nbsp;
	@Override
	<span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000066; font-weight: bold;">void</span> doGet<span style="color: #009900;">&#40;</span>HttpServletRequest req, HttpServletResponse resp<span style="color: #009900;">&#41;</span>
			<span style="color: #000000; font-weight: bold;">throws</span> ServletException, <span style="color: #003399;">IOException</span> <span style="color: #009900;">&#123;</span>
		JSONObject jsonObject <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> JSONObject<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
			Enumeration<span style="color: #339933;">&lt;</span>String<span style="color: #339933;">&gt;</span> names <span style="color: #339933;">=</span> req.<span style="color: #006633;">getHeaderNames</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000000; font-weight: bold;">while</span><span style="color: #009900;">&#40;</span>names.<span style="color: #006633;">hasMoreElements</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #003399;">String</span> name <span style="color: #339933;">=</span> names.<span style="color: #006633;">nextElement</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				jsonObject.<span style="color: #006633;">put</span><span style="color: #009900;">&#40;</span>name, req.<span style="color: #006633;">getHeader</span><span style="color: #009900;">&#40;</span>name<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
			resp.<span style="color: #006633;">setContentType</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;application/json&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			resp.<span style="color: #006633;">getWriter</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">print</span><span style="color: #009900;">&#40;</span>jsonObject<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span>JSONException e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			e.<span style="color: #006633;">printStackTrace</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p><em>AboutMyRequestServlet.java</em></p>
<p><strong>Konfiguration</strong></p>
<p>Damit das Servlet im Container bekannt ist (&lt;servlet&gt;) und &#252;ber eine URL aufl&#246;sbar ist (&lt;servlet-mapping&gt;), muss folgende Konfiguration in der Datei &#8220;war/WEB-INF/web.xml&#8221; hinzugef&#252;gt werden.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>AboutMyRequest<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>tld.sld.my.example.AboutMyRequestServlet<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet-mapping<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>AboutMyRequest<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;url-pattern<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/aboutmyrequest<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/url-pattern<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet-mapping<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p><em>web.xml</em></p>
<p>Anschlie&#223;end kann die Webanwendung &#252;ber &#8220;Run / Run As / Web Application&#8221; gestartet werden und lokal &#252;ber <a href="http://localhost:8888/aboutmyrequest" target="_blank">http://localhost:8888/aboutmyrequest</a> getestet werden. </p>
<p><strong>Antworten</strong></p>
<p>Nach erfolgreicher Publizierung in der Google App Engine kann auf das Servlet &#252;ber http://myappid.appspot.com/aboutmyrequest wie z.B. <a href="http://mgsimon.appspot.com/aboutmyrequest" target="_blank">http://mgsimon.appspot.com/aboutmyrequest</a> zugegriffen werden.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#123;</span>
    <span style="color: #3366CC;">&quot;Accept-Language&quot;</span><span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;de-de,de;q=0.8,en-us;q=0.5,en;q=0.3&quot;</span><span style="color: #339933;">,</span>
    <span style="color: #3366CC;">&quot;Host&quot;</span><span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;mgsimon.appspot.com&quot;</span><span style="color: #339933;">,</span>
    <span style="color: #3366CC;">&quot;Accept-Charset&quot;</span><span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;ISO-8859-1,utf-8;q=0.7,*;q=0.7&quot;</span><span style="color: #339933;">,</span>
    <span style="color: #3366CC;">&quot;X-AppEngine-Country&quot;</span><span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;DE&quot;</span><span style="color: #339933;">,</span>
    <span style="color: #3366CC;">&quot;User-Agent&quot;</span><span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; de; rv:1.9.2.23) Gecko/20110920 Firefox/3.6.23&quot;</span><span style="color: #339933;">,</span>
    <span style="color: #3366CC;">&quot;Accept&quot;</span><span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8&quot;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p><em>Antwort einer Anfrage durch Mozilla Firefox unter Mac OS X auf einem MacBook Pro</em></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#123;</span>
    <span style="color: #3366CC;">&quot;Host&quot;</span><span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;mgsimon.appspot.com&quot;</span><span style="color: #339933;">,</span>
    <span style="color: #3366CC;">&quot;Referer&quot;</span><span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;http://mgsimon.de/&quot;</span><span style="color: #339933;">,</span>
    <span style="color: #3366CC;">&quot;X-AppEngine-Country&quot;</span><span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;DE&quot;</span><span style="color: #339933;">,</span>
    <span style="color: #3366CC;">&quot;User-Agent&quot;</span><span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;Mozilla/5.0 (Linux; U; Android 2.3.3; de-de; HTC_DesireZ_A7272 Build/GRI40) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1&quot;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p><em>Antwort einer Anfrage durch Browser unter Android auf einem HTC Desire Z</em><br />
<div style="background-color: rgb(191, 228, 255); border:1px solid rgb(128, 201, 255); color: rgb(0, 0, 0); margin:0 0 1.5em; overflow:auto; padding: 3px;">
<img src="/wp-content/plugins/MyShortCodes/info.png" alt="Hinweis" title="Hinweis" width="24" height="24" style="margin: 4px 8px 0 0; float:left;"/>Die Anfrage wird durch die Google App Engine um zus&#228;tzliche Informationen wie z.B. die i18n Info &#8220;X-AppEngine-Country&#8221;:&#8221;DE&#8221; erweitert.</div></p>
<p><strong>Weiter &#8230;</strong></p>
<ul>
<li><a href="http://tools.ietf.org/html/rfc4627" target="_blank">rfc4627</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://mgsimon.de/2011/10/30/google-app-engine-und-json-aboutmyrequest-ein-beispiel/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Hello World Google App Engine</title>
		<link>http://mgsimon.de/2011/10/25/hello-world-google-app-engine/</link>
		<comments>http://mgsimon.de/2011/10/25/hello-world-google-app-engine/#comments</comments>
		<pubDate>Tue, 25 Oct 2011 15:19:39 +0000</pubDate>
		<dc:creator>mg</dc:creator>
				<category><![CDATA[Hosting]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[App]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Engine]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Servlet]]></category>

		<guid isPermaLink="false">http://mgsimon.de/?p=3132</guid>
		<description><![CDATA[Google App Engine ist eine Plattform zum Entwickeln und Hosten von Webanwendungen auf den Servern von Google. Dabei werden die Ressourcen in der Infrastruktur von Google dynamisch in Abh&#228;ngigkeit der Last zugewiesen. Ohne sich Gedanken um CPU, Bandbreite oder Speicher machen zu m&#252;ssen, werden laut Google bis zu 5 Millionen Seitenaufrufe pro Monat kostenlos und [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://code.google.com/intl/de-DE/appengine/" target="_blank">Google App Engine</a> ist eine Plattform zum Entwickeln und Hosten von Webanwendungen auf den Servern von Google.  Dabei werden die Ressourcen in der Infrastruktur von Google dynamisch in Abh&#228;ngigkeit der Last zugewiesen. Ohne sich Gedanken um CPU, Bandbreite oder Speicher machen zu m&#252;ssen, werden laut Google bis zu 5 Millionen Seitenaufrufe pro Monat kostenlos und dar&#252;ber hinaus zu <a href="http://code.google.com/intl/de-DE/appengine/docs/billing.html" target="_blank">wettbewerbsf&#228;higen Preisen</a> angeboten.<br />
<div id="attachment_3176" class="wp-caption alignnone" style="width: 452px"><img src="http://mgsimon.de/wp-content/uploads/2011/10/HelloWorldGoogleAppEngineMozillaFirefox.png" alt="Hello World Google App Engine :: Mozilla Firefox" title="Hello World Google App Engine :: Mozilla Firefox" width="442" height="137" class="size-full wp-image-3176 stamp" /><p class="wp-caption-text">Hello World Google App Engine :: Mozilla Firefox</p></div> Die Anwendungen k&#246;nnen in einer Umgebung f&#252;r Phyton oder Java umgesetzt werden. </p>
<p>&#8220;Hello World&#8221; in der Google App Engine, ein erstes kleines Beispiel in Java. Ab in die Cloud, schnell, schneller, am schnellsten &#8230;</p>
<p><span id="more-3132"></span><div style="background-color: rgb(191, 228, 255); border:1px solid rgb(128, 201, 255); color: rgb(0, 0, 0); margin:0 0 1.5em; overflow:auto; padding: 3px;">
<img src="/wp-content/plugins/MyShortCodes/info.png" alt="Hinweis" title="Hinweis" width="24" height="24" style="margin: 4px 8px 0 0; float:left;"/>Das folgende Beispiel wurde unter Mac OS X 10.6.8 mit der Java Version 1.6.0_26, Eclipse EE 3.7.1 Indigo und Google Plugin f&#252;r Eclipse 2.4.1 durchgef&#252;hrt.</div><br />
<strong>Google App Engine Account</strong></p>
<p>F&#252;r die Verwendung der Google App Engine ist ein Google-Konto und die Anmeldung unter <a href="http://appengine.google.com" target="_blank">appengine.google.com</a> notwendig. </p>
<p>Einfach mit der E-Mail und dem Passwort anmelden und auf der folgenden Seite &#252;ber &#8220;Create Application&#8221; das eigene Konto durch eine Handynummer best&#228;tigen. Eine SMS mit einem Code zur Best&#228;tigung wird unmittelbar an die angegebene Nummer gesendet. Nach der Best&#228;tigung kann die erste Anwendung erstellt werden. </p>
<p>&#8220;Application Identifier&#8221;, &#8220;Application Title, &#8220;I accept these terms.&#8221; und die Anwendung kann &#252;ber &#8220;Create Application&#8221; erstellt werden.</p>
<p><div style="background-color: rgb(191, 255, 191); border:1px solid rgb(128, 255, 128); color: rgb(0, 0, 0); margin:0 0 1.5em; overflow:auto; padding: 3px;">
<img src="/wp-content/plugins/MyShortCodes/tip.png" alt="Tipp" title="Tipp" width="24" height="24" style="margin: 4px 8px 0 0; float:left;" />Auf der Suche nach einem noch verf&#252;gbarem &#8220;Application Identifier&#8221; kann der Name des eigenen Google-Kontos verwendet werden, dieser sollten in der Regel f&#252;r das eigene Konto reserviert sein.</div> <div id="attachment_3155" class="wp-caption alignnone" style="width: 452px"><img src="http://mgsimon.de/wp-content/uploads/2011/10/HelloWorldGoogleAppEngineDashboard.png" alt="Hello World Google App Engine :: Dashboard" title="Hello World Google App Engine :: Dashboard" width="442" height="276" class="size-full wp-image-3155 stamp" /><p class="wp-caption-text">Hello World Google App Engine :: Dashboard</p></div> <strong>Entwicklungsumgebung Eclipse</strong></p>
<p>Anwendungen f&#252;r die Google App Engine k&#246;nnen mit dem <a href="http://code.google.com/intl/de-DE/appengine/downloads.html#Google_App_Engine_SDK_for_Java" target="_blank">SDK f&#252;r Java</a> manuell oder mit etwas mehr Benutzerfreundlichkeit dem <a href="http://code.google.com/intl/de-DE/appengine/downloads.html#Download_the_Google_Plugin_for_Eclipse" target="_blank">Google Plugin</a> in der IDE Eclipse erstellt werden.</p>
<p><a href="http://www.eclipse.org/downloads/" target="_blank">Eclipse herunterladen</a>, Archiv extrahieren, Eclipse starten und das Google Repository &#252;ber &#8220;Help / Install New Software&#8230; / Add&#8230;&#8221; mit folgenden Angaben hinzuf&#252;gen.</p>
<ul>
<li>Name: Google</li>
<li>Location: http://dl.google.com/eclipse/plugin/3.7</li>
</ul>
<p><div style="background-color: rgb(191, 255, 191); border:1px solid rgb(128, 255, 128); color: rgb(0, 0, 0); margin:0 0 1.5em; overflow:auto; padding: 3px;">
<img src="/wp-content/plugins/MyShortCodes/tip.png" alt="Tipp" title="Tipp" width="24" height="24" style="margin: 4px 8px 0 0; float:left;" />Google stellt das Plugin f&#252;r mehrere Eclipse Versionen (Galileo, Helios, Indigo &#8230;) in verschiedene Repositories bereit. Die Adressen f&#252;r die jeweilige Version sind unter <a href="http://code.google.com/intl/de-DE/eclipse/docs/download.html" target="_blank">Google Plugin f&#252;r Eclipse</a> aufgelistet.</div> Anschlie&#223;end wird das Google Plugin f&#252;r Eclipse zur Installation angeboten.</p>
<p><div id="attachment_3180" class="wp-caption alignnone" style="width: 452px"><img src="http://mgsimon.de/wp-content/uploads/2011/10/HelloWorldGoogleAppEngineInstallAvailableSoftware.png" alt="Hello World Google App Engine :: Install Available Software" title="Hello World Google App Engine :: Install Available Software" width="442" height="344" class="size-full wp-image-3180 stamp" /><p class="wp-caption-text">Hello World Google App Engine :: Install Available Software</p></div> Nach der Installation werden einige neue Funktionen in Eclipse durch das Google Plugin f&#252;r Eclipse angeboten.</p>
<div id="attachment_3198" class="wp-caption alignnone" style="width: 287px"><img src="http://mgsimon.de/wp-content/uploads/2011/10/HelloWorldGoogleAppEngineEclipsePlugin.png" alt="Hello World Google App Engine :: Eclipse Plugin" title="Hello World Google App Engine :: Eclipse Plugin" width="277" height="191" class="size-full wp-image-3198 stamp" /><p class="wp-caption-text">Hello World Google App Engine :: Eclipse Plugin</p></div>
<p><strong>Hello World</strong></p>
<p>Einfach &#252;ber &#8220;File / New / Project &#8230;&#8221; ein &#8220;Google / Web Application Project&#8221; ausw&#228;hlen und durch &#8220;Next >&#8221; mit folgenden Einstellungen &#252;ber &#8220;Finish&#8221; ein neues Projekt erstellen.</p>
<ul>
<li>Project name: HelloWorldGoogleAppEngine</li>
<li>Package: tld.sld.my.example</li>
<li>Use Google Web Toolkit abw&#228;hlen</li>
</ul>
<p><div id="attachment_3173" class="wp-caption alignnone" style="width: 452px"><img src="http://mgsimon.de/wp-content/uploads/2011/10/HelloWorldGoogleAppEngineCreateWebApplicationProject.png" alt="Hello World Google App Engine :: Create Web Application Project" title="Hello World Google App Engine :: Create Web Application Project" width="442" height="590" class="size-full wp-image-3173 stamp" /><p class="wp-caption-text">Hello World Google App Engine :: Create Web Application Project</p></div> Die notwendige Verzeichnisstruktur und initiale Konfiguration wird mit dem folgendem Servlet durch das Plugin automatisch erstellt.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">tld.sld.my.example</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.IOException</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.servlet.http.*</span><span style="color: #339933;">;</span>
&nbsp;
@SuppressWarnings<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;serial&quot;</span><span style="color: #009900;">&#41;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> HelloWorldGoogleAppEngineServlet <span style="color: #000000; font-weight: bold;">extends</span> HttpServlet <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> doGet<span style="color: #009900;">&#40;</span>HttpServletRequest req, HttpServletResponse resp<span style="color: #009900;">&#41;</span>
			<span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">IOException</span> <span style="color: #009900;">&#123;</span>
		resp.<span style="color: #006633;">setContentType</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;text/plain&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		resp.<span style="color: #006633;">getWriter</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Hello, world&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Das erste Servlet &#8220;Hello World Google App Engine&#8221; ohne eine Zeile selbst geschrieben zu haben &#8230; ;)</p>
<p><strong>Test</strong></p>
<p>Die Entwicklungsumgebung bietet durch das Google Plugin f&#252;r Eclipse eine lokale Simulationsumgebung an. </p>
<p>Die Google App Engine Web Anwendung wird bei selektiertem Projekt &#252;ber &#8220;Run / Run As / Web Application&#8221; lokal gestartet und im Browser kann &#252;ber die URL http://localhost:8888/ die folgende Startseite geladen werden.<br />
<div id="attachment_3204" class="wp-caption alignnone" style="width: 452px"><img src="http://mgsimon.de/wp-content/uploads/2011/10/HelloWorldGoogleAppEngineHelloAppEngine.png" alt="Hello World Google App Engine :: Hello App Engine" title="Hello World Google App Engine :: Hello App Engine" width="442" height="164" class="size-full wp-image-3204 stamp" /><p class="wp-caption-text">Hello World Google App Engine :: Hello App Engine</p></div> Der Quelltext der Startseite befindet sich in der Datei &#8220;/war/index.html&#8221;. Der erste Link &#8220;HelloWorldGoogleAppEngine&#8221; zeigt auf das zuvor erstellte Servlet.</p>
<p><div id="attachment_3176" class="wp-caption alignnone" style="width: 452px"><img src="http://mgsimon.de/wp-content/uploads/2011/10/HelloWorldGoogleAppEngineMozillaFirefox.png" alt="Hello World Google App Engine :: Mozilla Firefox" title="Hello World Google App Engine :: Mozilla Firefox" width="442" height="137" class="size-full wp-image-3176 stamp" /><p class="wp-caption-text">Hello World Google App Engine :: Mozilla Firefox</p></div> <strong>Ab in die Cloud &#8230;</strong></p>
<p>Damit das erste Beispiel im weltweiten Netz erreichbar ist, muss die Anwendung in die Cloud von Google publiziert werden. </p>
<p>In der Konfigurationsdatei appengine-web.xml unter &#8220;war/WEB-INF&#8221; die eigene zuvor erstellte Anwendungs-ID (myappid) eintragen.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;appengine-web-app</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://appengine.google.com/ns/1.0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;application<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>myappid<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/application<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
  <span style="color: #808080; font-style: italic;">&lt;!--</span>
<span style="color: #808080; font-style: italic;">    By default, App Engine sends requests serially to a given web server.</span>
<span style="color: #808080; font-style: italic;">    To allow App Engine to send multiple requests in parallel specify:</span>
&nbsp;
<span style="color: #808080; font-style: italic;">      &lt;threadsafe&gt;true&lt;/threadsafe&gt;</span>
<span style="color: #808080; font-style: italic;">  --&gt;</span>
&nbsp;
  <span style="color: #808080; font-style: italic;">&lt;!-- Configure java.util.logging --&gt;</span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;system-properties<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;java.util.logging.config.file&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;WEB-INF/logging.properties&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/system-properties<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/appengine-web-app<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Das Projekt kann &#252;ber das Kontextmen&#252; &#8220;Google / Deploy to App Engine&#8221; zur App Engine von Google &#252;bertragen werden.</p>
<p>Anschlie&#223;end kann auf die Anwendung &#252;ber http://myappid.appspot.com (myappid = zuvor erstellter Application Identifier) wie z.B. <a href="http://mgsimon.appspot.com" target="_blank">http://mgsimon.appspot.com</a> zugegriffen werden.</p>
<p>Fertig &#8230; erst einmal. ;)</p>
<p><strong>Weiter &#8230;</strong></p>
<ul>
<li><a href="http://code.google.com/intl/de-DE/appengine/" title="Google App Engine Projekt" target="_blank">Google App Engine Projekt</a></li>
<li><a href="http://code.google.com/intl/de-DE/appengine/docs/" title="Google App Engine Dokumentation" target="_blank">Google App Engine Dokumentation</a></li>
<li><a href="http://code.google.com/intl/de-DE/appengine/docs/java/javadoc/" title="Google App Engine Javadoc" target="_blank">Google App Engine Javadoc</a></li>
<li><a href="https://appengine.google.com/" title="Google App Engine Administration" target="_blank">Google App Engine Administration</a></li>
<li><a href="http://www.amazon.de/gp/product/B003DL3NT8/ref=as_li_ss_tl?ie=UTF8&#038;tag=mgs-21&#038;linkCode=as2&#038;camp=1638&#038;creative=19454&#038;creativeASIN=B003DL3NT8" title="Programming Google App Engine (Animal Guide)" target="_blank">Programming Google App Engine (Animal Guide)</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://mgsimon.de/2011/10/25/hello-world-google-app-engine/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Goolge Wave Invites &#8230;</title>
		<link>http://mgsimon.de/2009/11/13/goolge-wave-invites/</link>
		<comments>http://mgsimon.de/2009/11/13/goolge-wave-invites/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 15:29:09 +0000</pubDate>
		<dc:creator>mg</dc:creator>
				<category><![CDATA[web2.0]]></category>
		<category><![CDATA[Google]]></category>

		<guid isPermaLink="false">http://mgsimon.de/?p=1518</guid>
		<description><![CDATA[&#8230; zu vergeben. Wer will noch mal, wer hat noch nicht? A la &#8220;First In – First Out&#8221; werde ich die Einladungen versenden. H&#228;tte da noch 5. :-)]]></description>
			<content:encoded><![CDATA[<p><img src="http://mgsimon.de/wp-content/uploads/2009/11/wavelogo.png" alt="wavelogo" title="wavelogo" class="alignleft size-full wp-image-1519" />&#8230; zu vergeben.</p>
<p>Wer will noch mal, wer hat noch nicht?</p>
<p>A la &#8220;First In – First Out&#8221; werde ich die Einladungen versenden.</p>
<p>H&#228;tte da noch 5. :-) </p>
]]></content:encoded>
			<wfw:commentRss>http://mgsimon.de/2009/11/13/goolge-wave-invites/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>

