<?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>sven.buschbeck &#187; example</title>
	<atom:link href="http://svenbuschbeck.net/wordpress/tag/example/feed/" rel="self" type="application/rss+xml" />
	<link>http://svenbuschbeck.net/wordpress</link>
	<description>. . . .portfolio.blog. . . .human-computer-interaction. .semantic-web. .computer-science. .communication-design. . . . . . . . . . . . . . . . . . . . . . . . .</description>
	<lastBuildDate>Tue, 31 Jan 2012 09:55:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Sorting lists in GWT</title>
		<link>http://svenbuschbeck.net/wordpress/2012/01/sorting-lists-in-gwt/</link>
		<comments>http://svenbuschbeck.net/wordpress/2012/01/sorting-lists-in-gwt/#comments</comments>
		<pubDate>Wed, 18 Jan 2012 09:50:26 +0000</pubDate>
		<dc:creator>Sven Buschbeck</dc:creator>
				<category><![CDATA[gwt]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[GAE]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://svenbuschbeck.net/wordpress/?p=1091</guid>
		<description><![CDATA[Quick one: Lists.sort(list, comparator) is not implemented in the GAE JVM. But, as a replacement/alternative, Collections.sort(list, comparator) is.]]></description>
			<content:encoded><![CDATA[<p>Quick one:<br />
<code>Lists.sort(list, comparator)</code> is not implemented in the GAE JVM.<br />
But, as a replacement/alternative, <code>Collections.sort(list, comparator)</code> is.</p>
]]></content:encoded>
			<wfw:commentRss>http://svenbuschbeck.net/wordpress/2012/01/sorting-lists-in-gwt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Execute Code When the GWT Application Is Going Down</title>
		<link>http://svenbuschbeck.net/wordpress/2011/02/how-to-execute-code-when-the-gwt-application-is-going-down/</link>
		<comments>http://svenbuschbeck.net/wordpress/2011/02/how-to-execute-code-when-the-gwt-application-is-going-down/#comments</comments>
		<pubDate>Mon, 28 Feb 2011 22:10:03 +0000</pubDate>
		<dc:creator>Sven Buschbeck</dc:creator>
				<category><![CDATA[gwt]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://svenbuschbeck.net/wordpress/?p=1051</guid>
		<description><![CDATA[My goal was to store the UI state of my application just before it gets terminated to be able to restore it next time the way the user left it the other day. I tried to add an addAttachHandler to the RootPanel to get informed about the root panel getting detached from the DOM so [...]]]></description>
			<content:encoded><![CDATA[<p>My goal was to store the UI state of my application just before it gets terminated to be able to restore it next time the way the user left it the other day.</p>
<p>I tried to add an <code>addAttachHandler</code> to the <code>RootPanel</code> to get informed about the root panel getting detached from the DOM so that I can finalize my application. Surprisingly, that does not work in Chrome (tested Chrome and Firefox only).</p>
<p>But besides that this sounds like a bug to me, I found the &#8220;proper&#8221; way of doing things before the application ends: </p>
<pre>Window.addWindowClosingHandler(new Window.ClosingHandler() {
	@Override public void onWindowClosing(ClosingEvent event) { ... }
});</pre>
<p>In the end, I think something like <code>Document.addUnloadHandler</code> would be more suggestive&#8230; closing the window or reloading a page is both exiting the application by unloading the DOM &#8211; not closing the window.</p>
]]></content:encoded>
			<wfw:commentRss>http://svenbuschbeck.net/wordpress/2011/02/how-to-execute-code-when-the-gwt-application-is-going-down/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Disable an Anchor in GWT</title>
		<link>http://svenbuschbeck.net/wordpress/2011/02/disable-an-anchor-in-gwt/</link>
		<comments>http://svenbuschbeck.net/wordpress/2011/02/disable-an-anchor-in-gwt/#comments</comments>
		<pubDate>Fri, 18 Feb 2011 12:27:12 +0000</pubDate>
		<dc:creator>Sven Buschbeck</dc:creator>
				<category><![CDATA[gwt]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[fix]]></category>

		<guid isPermaLink="false">http://svenbuschbeck.net/wordpress/?p=1033</guid>
		<description><![CDATA[Unexpectedly, calling setEnabled(false) does not prevent a link/anchor from being clicked. That means, the click events still get triggered. The reason is more or less a bug in GWT as it updates the list of events that are going to be triggered only at the moment when it gets attached to the DOM (Btw, in [...]]]></description>
			<content:encoded><![CDATA[<p>Unexpectedly, calling <code>setEnabled(false)</code> does not prevent a link/anchor from being clicked. That means, the click events still get triggered.<br />
The reason is more or less a bug in GWT as it updates the list of events that are going to be triggered only at the moment when it gets attached to the DOM (Btw, in GWT, this process is called to sink and to unsink events, where the former enables a specific event to be triggered and the latter disables it).<br />
I found a workaround by creating my own Anchor class and forcing the underlying GWT Anchor to update the list of events to be sunk.</p>
<pre>...
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.Event;

public class Anchor extends com.google.gwt.user.client.ui.Anchor {

	@Override public void setEnabled(boolean enabled) {
		super.setEnabled(enabled);
		if (isAttached()) {
			onDetach();
			if (enabled) {
				sinkEvents(Event.ONCLICK);
			} else {
				unsinkEvents(Event.ONCLICK);
			}
			onAttach();
		}
	}

	@Override protected void onLoad() {
		super.onLoad();
		if (isEnabled()) {
			sinkEvents(Event.ONCLICK);
		} else {
			unsinkEvents(Event.ONCLICK);
		}
	}
}</pre>
<p>Note the <code>onLoad</code> method, it sets up the state when the widget gets attached to the DOM the first time. It is required because <code>setEnabled()</code> could have been called before the anchor got attached.</p>
<p>If you encountered the same issue, please vote for this <a href="http://code.google.com/p/google-web-toolkit/issues/detail?id=6045">bug report</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://svenbuschbeck.net/wordpress/2011/02/disable-an-anchor-in-gwt/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Java Cookies from the Future Past</title>
		<link>http://svenbuschbeck.net/wordpress/2011/02/java-going-back-to-the-future/</link>
		<comments>http://svenbuschbeck.net/wordpress/2011/02/java-going-back-to-the-future/#comments</comments>
		<pubDate>Mon, 07 Feb 2011 13:58:03 +0000</pubDate>
		<dc:creator>Sven Buschbeck</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[pitfall]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://svenbuschbeck.net/wordpress/?p=999</guid>
		<description><![CDATA[While working with cookies in Java/GWT and thus—to set the expire date—with Date, I found a doubtful Java behavior. My goal was to set a cookie to expire in about one month from today like this: Date expires = new Date(new Date().getTime() + 1000 * 60 * 60 * 24 * 30); Cookies.setCookie("myCookie", "myData", expires); [...]]]></description>
			<content:encoded><![CDATA[<p>While working with cookies in Java/GWT and thus—to set the expire date—with <code>Date</code>, I found a doubtful Java behavior.</p>
<p>My goal was to set a cookie to expire in about one month from today like this:</p>
<pre>Date expires = new Date(new Date().getTime() + 1000 * 60 * 60 * 24 * 30);
Cookies.setCookie("myCookie", "myData", expires);</pre>
<p>And kept wondering why the cookie never got stored.</p>
<p>And finally created a simple test case like this:</p>
<pre>Date today = new Date();
Date tomorrow = new Date(today.getTime() + 1000 * 60 * 60 * 24);
Date nextMonth = new Date(today.getTime() + 1000 * 60 * 60 * 24 * 30);</pre>
<p>And got following dates:</p>
<pre>today=Mon Feb 07 14:27:50 CET 2011
tomorrow=Tue Feb 08 14:27:50 CET 2011
nextMonth=Tue Jan 18 21:25:02 CET 2011</pre>
<p>According to Java&#8217;s calculation, the cookie was expired already before even being set. </p>
<p>Took me a bit to understand why:<br />
1000 * 60 * 60 * 24 * 30 = 2,592,000,000 = 0x9A7EC800<br />
Thus, the first bit got set to one&#8230; a classical overflow causing the integer value to become negative &#8211; just try:</p>
<pre>System.out.println(1000 * 60 * 60 * 24 * 30);</pre>
<p>It will print out <code>-1702967296</code>.</p>
<p>Fix: Add a little <code>L</code> will solve the issue by forcing the compiler to calculate using the scope of <code>long</code>:</p>
<pre>Date nextMonthLong = new Date(today.getTime() + 1000L * 60 * 60 * 24 * 30);</pre>
<p>I guess I will fall for that one again sometime as the error is not obvious in my opinion — especially because <code>getTime()</code> returns a <code>long</code> and still, the compiler sticks with an <code>int</code> for the multiplication part. </p>
]]></content:encoded>
			<wfw:commentRss>http://svenbuschbeck.net/wordpress/2011/02/java-going-back-to-the-future/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Disable Context Menu in GWT</title>
		<link>http://svenbuschbeck.net/wordpress/2011/02/disable-context-menu-in-gwt/</link>
		<comments>http://svenbuschbeck.net/wordpress/2011/02/disable-context-menu-in-gwt/#comments</comments>
		<pubDate>Fri, 04 Feb 2011 21:10:12 +0000</pubDate>
		<dc:creator>Sven Buschbeck</dc:creator>
				<category><![CDATA[gwt]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://svenbuschbeck.net/wordpress/?p=984</guid>
		<description><![CDATA[To make use of the right mouse button, it is necessary to disable the native browser context menu (the popup menu appearing on right click). This can be achieved like this: RootLayoutPanel.get().addDomHandler(new ContextMenuHandler() { @Override public void onContextMenu(ContextMenuEvent event) { event.preventDefault(); event.stopPropagation(); } }, ContextMenuEvent.getType()); Same should work for RootPanel. After that, it is possible [...]]]></description>
			<content:encoded><![CDATA[<p>To make use of the right mouse button, it is necessary to disable the native browser context menu (the popup menu appearing on right click). This can be achieved like this:</p>
<pre>RootLayoutPanel.get().addDomHandler(new ContextMenuHandler() {

	@Override public void onContextMenu(ContextMenuEvent event) {
		event.preventDefault();
		event.stopPropagation();
	}
}, ContextMenuEvent.getType());</pre>
<p>Same should work for <code>RootPanel</code>.</p>
<p>After that, it is possible to make use of the right mouse button for example like this:</p>
<pre>someWidget.addDomHandler(new MouseMoveHandler() {

	@Override public void onMouseMove(MouseMoveEvent event) {
		if (event.getNativeButton() == NativeEvent.BUTTON_RIGHT) {
		...</pre>
]]></content:encoded>
			<wfw:commentRss>http://svenbuschbeck.net/wordpress/2011/02/disable-context-menu-in-gwt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Authentication with FlickrJ</title>
		<link>http://svenbuschbeck.net/wordpress/2011/02/authentication-with-flickrj/</link>
		<comments>http://svenbuschbeck.net/wordpress/2011/02/authentication-with-flickrj/#comments</comments>
		<pubDate>Wed, 02 Feb 2011 22:41:18 +0000</pubDate>
		<dc:creator>Sven Buschbeck</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[flickr]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[web application]]></category>

		<guid isPermaLink="false">http://svenbuschbeck.net/wordpress/?p=961</guid>
		<description><![CDATA[When you know about username and password logins, the whole Flickr authentication process for web applications seems a little weird on first sight, nevertheless it is logical and necessary after you have done some reading (for example the official Flickr WebApp Auth HowTo). To get started and into coding quickly (using FlickrJ and Java) I [...]]]></description>
			<content:encoded><![CDATA[<p>When you know about username and password logins, the whole Flickr authentication process for web applications seems a little weird on first sight, nevertheless it is logical and necessary after you have done some reading (for example the official <a href="http://www.flickr.com/services/api/auth.howto.web.html">Flickr WebApp Auth HowTo</a>).<br />
To get started and into coding quickly (using <a href="http://flickrj.sourceforge.net/">FlickrJ</a> and Java) I recommend <a href="https://www.phillconrad.org/cisc474/Wiki.jsp?page=Flickr_Authentication">this page</a>. Especially the code example is excellent in my opinion! Thanks Andy Sacher!</p>
]]></content:encoded>
			<wfw:commentRss>http://svenbuschbeck.net/wordpress/2011/02/authentication-with-flickrj/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Casting collections in Java</title>
		<link>http://svenbuschbeck.net/wordpress/2010/12/casting-collections-in-java/</link>
		<comments>http://svenbuschbeck.net/wordpress/2010/12/casting-collections-in-java/#comments</comments>
		<pubDate>Tue, 14 Dec 2010 10:49:13 +0000</pubDate>
		<dc:creator>Sven Buschbeck</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://svenbuschbeck.net/wordpress/?p=937</guid>
		<description><![CDATA[Assuming two classes A and B as class A {} class B extends A {} It is just logical that casting B to A works fine: A anObjectOfClassA = new B(); But when it comes to collections of As and Bs, a strange phenomenon appears in Java: Collection&#60;B&#62; collectionOfBs = new LinkedList&#60;B&#62;(); Collection&#60;A&#62; collectionOfAs = [...]]]></description>
			<content:encoded><![CDATA[<p>Assuming two classes A and B as</p>
<pre>class A {}
class B extends A {}</pre>
</p>
<p>It is just logical that casting B to A works fine:</p>
<pre>A anObjectOfClassA = new B();</pre>
</p>
<p>But when it comes to collections of As and Bs, a strange phenomenon appears in Java:</p>
<pre>Collection&lt;B&gt; collectionOfBs = new LinkedList&lt;B&gt;();
Collection&lt;A&gt; collectionOfAs = (Collection&lt;A&gt;)collectionOfBs; // this line does not compile!</pre>
<p>That is, though the collection wrapper (the java.util.Collection class) is the same and B extends A, casting a collection of objects of class B to a collection of objects of class A throws an compile-time error.
</p>
<p>But it works using generics (the whole class for the sake of completeness and reusability):</p>
<pre>import java.util.Collection;
import java.util.LinkedList;

public class CollectionCastingExample {

  class A {}
  class B extends A {}

  Collection&lt;B&gt; collectionOfBs = new LinkedList&lt;B&gt;();
//  Collection&lt;A&gt; collectionOfAs = (Collection&lt;A&gt;)collectionOfBs;

  Collection&lt;A&gt; collectionOfAs = downCastCollection(collectionOfBs, A.class);

  /**
   * Casts a collection of objects of class B where B extends A to a collection of objects of class A.
   *
   * @param &lt;T&gt; Base class
   * @param collection Collection of objects of a class extending T
   * @param aClass Representation of T
   * @return Collection of objects of T casted from given collection of objects of a class extending T.
   */
  @SuppressWarnings("unchecked")
  public static &lt;T&gt; Collection&lt;T> downCastCollection(Collection&lt;? extends T&gt; collection,
      Class&lt;T&gt; aClass) {
    return (Collection&lt;T&gt;) collection;
  }
}</pre>
<p>Despite the fact that a <code>@SuppressWarnings("unchecked")</code> is required, it avoids iterating over the whole collection of Bs and casting each of them from B to A plus adding them to a new collection of As.</p>
]]></content:encoded>
			<wfw:commentRss>http://svenbuschbeck.net/wordpress/2010/12/casting-collections-in-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding a New Service (GWT)</title>
		<link>http://svenbuschbeck.net/wordpress/2010/12/adding-a-new-service-gwt/</link>
		<comments>http://svenbuschbeck.net/wordpress/2010/12/adding-a-new-service-gwt/#comments</comments>
		<pubDate>Fri, 03 Dec 2010 15:02:08 +0000</pubDate>
		<dc:creator>Sven Buschbeck</dc:creator>
				<category><![CDATA[gwt]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://svenbuschbeck.net/wordpress/?p=930</guid>
		<description><![CDATA[Adding a new servlet/service to you GWT application is quite straight forward, e.g. by copying the example &#8220;greetingService&#8221; or creating a new servlet. But it&#8217;s easy to overlook a required change/adjustment of your project&#8217;s configuration and you might end up with an error message like &#8220;Blocked attempt to access interface &#8216;some.package.SomeService&#8217;, which is not implemented [...]]]></description>
			<content:encoded><![CDATA[<p>Adding a new servlet/service to you GWT application is quite straight forward, e.g. by copying the example &#8220;greetingService&#8221; or creating a new servlet. But it&#8217;s easy to overlook a required change/adjustment of your project&#8217;s configuration and you might end up with an error message like &#8220;Blocked attempt to access interface &#8216;some.package.SomeService&#8217;, which is not implemented by &#8216;some.other.package.SomeOtherServiceImpl&#8217;; this is either misconfiguration or a hack attempt&#8221;.</p>
<p>Check list (<strong>some</strong> should be replaced with whatever you want to call your new service):</p>
<ul>
<li>Copy or create files:<br />
<strong>Some</strong>Service.java and <strong>Some</strong>ServiceAsync.java in client package<br />
<strong>Some</strong>ServiceImpl.java in server package + change implementation statement to <strong>Some</strong>Service</li>
<li>Adjust web.xml:
<pre>&lt;servlet&gt;
	&lt;servlet-name&gt;<strong>some</strong>Servlet&lt;/servlet-name&gt;
	&lt;servlet-class&gt;some.package.<strong>Some</strong>ServiceImpl&lt;/servlet-class&gt;
&lt;/servlet&gt;
&lt;servlet-mapping&gt;
	&lt;servlet-name&gt;<strong>some</strong>Servlet&lt;/servlet-name&gt;
	&lt;url-pattern&gt;/[copy base directory name from other service declaration]/<strong>some</strong>&lt;/url-pattern&gt;
&lt;/servlet-mapping&gt;</pre>
</li>
<li>Annotate interface SomeService.java:
<pre>@RemoteServiceRelativePath("<strong>some</strong>")</pre>
</li>
<li>Connect to your new service in the client:
<pre>private final <strong>Some</strong>ServiceAsync someService = GWT.create(<strong>Some</strong>Service.class);</pre>
</li>
</ul>
<p>Definitely some possibilities to make a mistakes or miss something here.</p>
]]></content:encoded>
			<wfw:commentRss>http://svenbuschbeck.net/wordpress/2010/12/adding-a-new-service-gwt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using the XML Parser in GWT</title>
		<link>http://svenbuschbeck.net/wordpress/2010/09/using-the-xml-parser-in-gwt/</link>
		<comments>http://svenbuschbeck.net/wordpress/2010/09/using-the-xml-parser-in-gwt/#comments</comments>
		<pubDate>Fri, 17 Sep 2010 15:16:23 +0000</pubDate>
		<dc:creator>Sven Buschbeck</dc:creator>
				<category><![CDATA[jobs]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[gwt]]></category>

		<guid isPermaLink="false">http://svenbuschbeck.net/wordpress/?p=882</guid>
		<description><![CDATA[I tried using the XML parsing features of the GWT like that: form.addSubmitCompleteHandler(new SubmitCompleteHandler() { @Override public void onSubmitComplete(SubmitCompleteEvent event) { // One time upload only, to upload again, user needs to start the upload process from scatch – keeping it simple for now panel.clear(); Window.alert(event.getResults()); Document result = XMLParser.parse(event.getResults()); ... }); But GWT kept [...]]]></description>
			<content:encoded><![CDATA[<p>I tried using the XML parsing features of the GWT like that:</p>
<pre>form.addSubmitCompleteHandler(new SubmitCompleteHandler() {
	@Override
	public void onSubmitComplete(SubmitCompleteEvent event) {
		// One time upload only, to upload again, user needs to start the upload process from scatch – keeping it simple for now
		panel.clear();
		Window.alert(event.getResults());
		Document result = XMLParser.parse(event.getResults());
		...
});</pre>
<p>But GWT kept telling me &#8220;No source code is available for type com.google.gwt.xml.client.Document; did you forget to inherit a required module?&#8221;. It turns out, you are required to explicitly add the XML functionalities to your project by adding following line to your &#8230;.gwt.xml file:</p>
<pre>&lt;inherits name='com.google.gwt.xml.XML'/&gt;</pre>
<p>Raises a question: What&#8217;s the point of AJAX (Asynchronous JavaScript and XML) without XML? Or in other words there is no AJAX without XML! So it&#8217;s up to you to add the AX part to GWT manually. What&#8217;s next?</p>
]]></content:encoded>
			<wfw:commentRss>http://svenbuschbeck.net/wordpress/2010/09/using-the-xml-parser-in-gwt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple redirection using PHP and HTML meta tag</title>
		<link>http://svenbuschbeck.net/wordpress/2009/08/simple-redirection-using-php-and-html-meta-tag/</link>
		<comments>http://svenbuschbeck.net/wordpress/2009/08/simple-redirection-using-php-and-html-meta-tag/#comments</comments>
		<pubDate>Wed, 05 Aug 2009 12:12:49 +0000</pubDate>
		<dc:creator>Sven Buschbeck</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://svenbuschbeck.net/wordpress/?p=756</guid>
		<description><![CDATA[Something everyone needs once in a while&#8230; maybe you moved a file on your server or you did not install wordpress in the root folder of your webserver &#8211; like I did neither &#8211; a redirection or forwarding can be an easy answer. The script is rather simple &#8211; it redirects in three ways to [...]]]></description>
			<content:encoded><![CDATA[<p>Something everyone needs once in a while&#8230; maybe you moved a file on your server or you did not install wordpress in the root folder of your webserver &#8211; like I did neither <img src='http://svenbuschbeck.net/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  &#8211; a redirection or forwarding can be an easy answer.</p>
<p>The script is rather simple &#8211; it redirects in three ways to provide a reasonable fall back if any of the automatic redirecting fails. To use it on your server, just enter the URL/address/file name/folder you would like the user to be redirected to in the second line of the page/script.</p>
<div>Put the whole code and markup in a file with file extension &#8220;.php&#8221;.</div>
<div>In my case, every user ending up at &#8220;www.svenbuschbeck.net&#8221; should to be forwarded to &#8220;www.svenbuschbeck.net/wordpress/home&#8221;. So I adjusted the script below like &#8220;$url = &#8216;wordpress/home&#8217;&#8221;, named the file &#8220;index.php&#8221; and put it in the root folder. Done <img src='http://svenbuschbeck.net/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</div>
<pre>&lt;?php
$url = 'put your URL between the parenthesis';
header("Location: $url");
?&gt;
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/&gt;
&lt;meta http-equiv="refresh" content="0;url=&lt;?php echo $url; ?&gt;"/&gt;
&lt;title&gt;You will be redirected... &lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
If you are not redirected automatically, please click &lt;a href="&lt;?php echo $url; ?&gt;"&gt;here&lt;/a&gt;.
&lt;/body&gt;
&lt;/html&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://svenbuschbeck.net/wordpress/2009/08/simple-redirection-using-php-and-html-meta-tag/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

