<?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>Information Technology Management &#38; Development &#187; web development</title>
	<atom:link href="http://blogs.yellowfish.biz/tag/web-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.yellowfish.biz</link>
	<description>IT Consulting, Infrastructure, Software &#38; Voip Phone Systems</description>
	<lastBuildDate>Tue, 27 Jul 2010 20:04:04 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>GWT Development with Traditional Servlets</title>
		<link>http://blogs.yellowfish.biz/2010/gwt-development-with-traditional-servlets/</link>
		<comments>http://blogs.yellowfish.biz/2010/gwt-development-with-traditional-servlets/#comments</comments>
		<pubDate>Fri, 25 Jun 2010 14:04:11 +0000</pubDate>
		<dc:creator>Praveen Ray</dc:creator>
				<category><![CDATA[Computer Languages]]></category>
		<category><![CDATA[Web Applications / User Interface Design]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[gwt]]></category>
		<category><![CDATA[jetty]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://blogs.yellowfish.biz/?p=363</guid>
		<description><![CDATA[If you&#8217;re developing GWT apps with traditional servlets (other than GWT-RPC) with your web server running as separate process, you can&#8217;t really send GWT Ajax messages from hosted mode since the outside process and port are considered to be another domain and GWT won&#8217;t send cross domain requests. One clean solution is to use a [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re developing GWT apps with traditional servlets (other than GWT-RPC) with your web server running as separate process, you can&#8217;t really send GWT Ajax messages from hosted mode since the outside process and port are considered to be another domain and GWT won&#8217;t send cross domain requests. One clean solution is to use a transparent proxy as hosted mode servlet and let that proxy talk to the real server. Here are the steps I took:<br />
Find following jars are copy them to  your GWT project:</p>
<pre code='java'>
{GWT-Project}/war/WEB-INF/lib
        jetty-http-7.1.3.v20100526.jar
        jetty-io-7.1.3.v20100526.jar
        jetty-servlets-7.1.3.v20100526.jar
        jetty-continuation-7.1.3.v20100526.jar
        jetty-util-7.1.3.v20100526.jar
        jetty-client-7.1.3.v20100526.jar
        jetty-jmx-7.1.3.v20100526.jar
</pre>
<p>Add these jars to Referenced Libraries -> Build Path -> Configure Build Path -> Libraries -> Add Jars.<br />
Don&#8217;t forget to make sure these jars are selected in &#8216;Order and Export&#8217; Tab.</p>
<p>Modify {GWT-Project}/war/WEB-INF/web.xml:</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;web-app<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>JettyContinuationFilter<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>org.eclipse.jetty.continuation.ContinuationFilter<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter-mapping<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>JettyContinuationFilter<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter-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>/app/*<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;/filter-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<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>jetty-proxy-servlet<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>org.eclipse.jetty.servlets.ProxyServlet$Transparent<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;init-param<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;param-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>ProxyTo<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/param-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;param-value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>http://localhost:8080/<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/param-value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/init-param<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;init-param<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;param-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Prefix<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/param-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;param-value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/param-value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/init-param<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;load-on-startup<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/load-on-startup<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>jetty-proxy-servlet<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>/app/*<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>   
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/web-app<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Now all your URLS in your GWT app starting with &#8216;/app&#8217; are normally forwarded to your traditional web server at localhost:8080.<br />
BTW, I got these jetty jars from my local maven .m2 repository. </p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.yellowfish.biz/2010/gwt-development-with-traditional-servlets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GWT Server Servlet ClassNotFoundException</title>
		<link>http://blogs.yellowfish.biz/2010/gwt-server-servlet-classnotfoundexception/</link>
		<comments>http://blogs.yellowfish.biz/2010/gwt-server-servlet-classnotfoundexception/#comments</comments>
		<pubDate>Fri, 04 Jun 2010 20:01:56 +0000</pubDate>
		<dc:creator>Praveen Ray</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[gwt]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://blogs.yellowfish.biz/?p=359</guid>
		<description><![CDATA[If you&#8217;re getting ClassNotFoundException for your GWT server servlets, even though the class exists and is ok, you might want to check out the Build Path in Eclipse and make sure All libraries are selected in

 Java Build Path -&#62; Order and Export.

The error message could be confusing and misleading. Hope this tip saves you [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re getting ClassNotFoundException for your GWT server servlets, even though the class exists and is ok, you might want to check out the Build Path in Eclipse and make sure All libraries are selected in</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"> Java Build Path <span style="color: #339933;">-&gt;</span> Order and Export.</pre></div></div>

<p>The error message could be confusing and misleading. Hope this tip saves you some time.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.yellowfish.biz/2010/gwt-server-servlet-classnotfoundexception/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Simple REST controller for Spring MVC</title>
		<link>http://blogs.yellowfish.biz/2009/a-simple-rest-controller-for-spring-mvc/</link>
		<comments>http://blogs.yellowfish.biz/2009/a-simple-rest-controller-for-spring-mvc/#comments</comments>
		<pubDate>Wed, 14 Oct 2009 18:23:22 +0000</pubDate>
		<dc:creator>Praveen Ray</dc:creator>
				<category><![CDATA[Computer Languages]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[design pattern]]></category>
		<category><![CDATA[mvc]]></category>
		<category><![CDATA[spring]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://blogs.yellowfish.biz/?p=247</guid>
		<description><![CDATA[RESTful programming is all the rage these days &#8211; at least in Rails world. It&#39;s a simple way to perform request dispatching which is easy to understand and maps database CRUD operations into web requests elegantly. While Rails comes with REST routing built in, there is no such support in Spring MVC. However, Spring&#39;s decoupled [...]]]></description>
			<content:encoded><![CDATA[<p><span style="background-color: #ffffff;">RESTful programming is all the rage these days &#8211; at least in Rails world. It&#39;s a simple way to perform request dispatching which is easy to understand and maps database CRUD operations into web requests elegantly. While Rails comes with REST routing built in, there is no such support in Spring MVC. However, Spring&#39;s decoupled design makes it rather easy to implement. Here&#39;s code I wrote to implement RESTful dispatches using Spring MVC.(Also available as a download <a href="http://www.yellowfish.biz/code/RESTMethodResolver.java">here</a>)</span></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;">com.yellowfish.servlets</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;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.log4j.*</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.*</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.springframework.web.servlet.mvc.multiaction.*</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> RESTMethodResolver <span style="color: #000000; font-weight: bold;">implements</span> MethodNameResolver <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">String</span> getHandlerMethodName<span style="color: #009900;">&#40;</span>HttpServletRequest req<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> NoSuchRequestHandlingMethodException <span style="color: #009900;">&#123;</span>
&nbsp;
        Logger log <span style="color: #339933;">=</span> Logger.<span style="color: #006633;">getLogger</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;com.yellowfish.servlets&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        log.<span style="color: #006633;">debug</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Resolving method name for the Request&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #003399;">String</span> method <span style="color: #339933;">=</span> req.<span style="color: #006633;">getParameter</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;_method&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #003399;">String</span> id     <span style="color: #339933;">=</span> req.<span style="color: #006633;">getParameter</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;id&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #003399;">String</span> http_method <span style="color: #339933;">=</span> req.<span style="color: #006633;">getMethod</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">toUpperCase</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #003399;">String</span> controller_method <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
&nbsp;
        log.<span style="color: #006633;">debug</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;method: &quot;</span><span style="color: #339933;">+</span>method<span style="color: #339933;">+</span><span style="color: #0000ff;">&quot; http_method: &quot;</span> <span style="color: #339933;">+</span> http_method <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot; id: &quot;</span><span style="color: #339933;">+</span>id<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>http_method.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;GET&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
            <span style="color: #003399;">String</span> uri <span style="color: #339933;">=</span> req.<span style="color: #006633;">getRequestURI</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            controller_method <span style="color: #339933;">=</span>  <span style="color: #009900;">&#40;</span>uri.<span style="color: #006633;">endsWith</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/new&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> <span style="color: #0000ff;">&quot;_new&quot;</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">&quot;show&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>controller_method <span style="color: #339933;">==</span> <span style="color: #0000ff;">&quot;show&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
                controller_method <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>id <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> <span style="color: #0000ff;">&quot;index&quot;</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">&quot;show&quot;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>http_method.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;POST&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
            <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>method <span style="color: #339933;">!=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
                method <span style="color: #339933;">=</span> method.<span style="color: #006633;">toUpperCase</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>id <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span>
&nbsp;
                    <span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> com.<span style="color: #006633;">yellowfish</span>.<span style="color: #006633;">servlets</span>.<span style="color: #006633;">ServletException</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;id cannot be NULL for PUT and DELETE&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>method.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;PUT&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
&nbsp;
                    controller_method <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;update&quot;</span><span style="color: #339933;">;</span>
&nbsp;
                <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>method.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;DELETE&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
&nbsp;
                    controller_method <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;delete&quot;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
&nbsp;
                controller_method <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;create&quot;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>controller_method <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
            log.<span style="color: #006633;">debug</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;No Controller Method Found&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> NoSuchRequestHandlingMethodException<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">null</span>, <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">getClass</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #009900;">&#125;</span>
&nbsp;
        log.<span style="color: #006633;">debug</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Controller method resolved to :&quot;</span> <span style="color: #339933;">+</span> controller_method<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        req.<span style="color: #006633;">setAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;controller_method_name&quot;</span>, controller_method<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>id <span style="color: #339933;">!=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
            <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
&nbsp;
                req.<span style="color: #006633;">setAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;model-id&quot;</span>, <span style="color: #003399;">Long</span>.<span style="color: #006633;">valueOf</span><span style="color: #009900;">&#40;</span>id<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">NumberFormatException</span> exp<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
                log.<span style="color: #006633;">warn</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;id&quot;</span> <span style="color: #339933;">+</span> id <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot; is not a Number&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">return</span> controller_method<span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

<p><span style="background-color: #ffffff;">Then simply declare this bean in the spring config:</span> <span style="background-color: #ffffff;"> </span></p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>bean class<span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;com.yellowfish.servlets.RESTMethodResolver&quot;</span> id<span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;rest-method-resolver&quot;</span><span style="color: #339933;">&gt;&lt;/</span>bean<span style="color: #339933;">&gt;</span></pre></div></div>

<p>It resolves incoming URL and Method as per following table:</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<table cellpadding="1" cellspacing="1" height="300" style="border:1px solid black;" width="550">
<caption>REST Resolver Rules</caption>
<tbody>
<tr>
<th align="center">URI</th>
<th align="center">GET/POST</th>
<th align="center">ID Parameter Present?</th>
<th align="center">_method Parameter Present?</th>
<th align="center">Method Name</th>
</tr>
<tr>
<td align="center">&nbsp;/server</td>
<td align="center">GET&nbsp;</td>
<td align="center">No&nbsp;</td>
<td align="center">N/A</td>
<td align="center">index</td>
</tr>
<tr>
<td align="center">/server/_new</td>
<td align="center">GET</td>
<td align="center">No</td>
<td align="center">N/A</td>
<td align="center">new</td>
</tr>
<tr>
<td align="center">/server?id=100</td>
<td align="center">GET</td>
<td align="center">Yes</td>
<td align="center">N/A</td>
<td align="center">show</td>
</tr>
<tr>
<td align="center">/server</td>
<td align="center">POST</td>
<td align="center">No&nbsp;</td>
<td align="center">No</td>
<td align="center">create&nbsp;</td>
</tr>
<tr>
<td align="center">&nbsp;/server</td>
<td align="center">POST&nbsp;</td>
<td align="center">Yes</td>
<td align="center">PUT</td>
<td align="center">update&nbsp;</td>
</tr>
<tr>
<td align="center">&nbsp;/server</td>
<td align="center">POST&nbsp;</td>
<td align="center">Yes&nbsp;</td>
<td align="center">DELETE</td>
<td align="center">delete&nbsp;</td>
</tr>
</tbody>
</table>
<p>&nbsp;To make life simple, the code above assumes all IDs to be numeric and if ID is present in incoming request, it creates a Request attribute called &#39;model-id&#39; .&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.yellowfish.biz/2009/a-simple-rest-controller-for-spring-mvc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Yaws and File Upload</title>
		<link>http://blogs.yellowfish.biz/2009/yaws-and-file-upload/</link>
		<comments>http://blogs.yellowfish.biz/2009/yaws-and-file-upload/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 01:27:05 +0000</pubDate>
		<dc:creator>Praveen Ray</dc:creator>
				<category><![CDATA[Computer Languages]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Web Frameworks]]></category>
		<category><![CDATA[erlang]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[yaws]]></category>

		<guid isPermaLink="false">http://blogs.yellowfish.biz/?p=204</guid>
		<description><![CDATA[Read multipart form data using yaws_api]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://yaws.hyber.org/code.yaws?file=/upload.yaws">example</a> at yaws web site to read the file upload is a good starting point but it&#39;s too simplistic. I extended the example so it&#39;s useful in the real world. (Update: Thanks to Steve Vinoski, this module(yaws_multipart) is now part of the yaws <a href="http://github.com/klacke/yaws">git</a> tree).</p>
<ol>
<li>It reads all parameters &#8211; files uploaded and other simple parameters .</li>
<li>It takes a few options to help file uploads. Specifically:
<ol>
<li>{max_file_size, MaxBytes} : If file exceeds MaxBytes bytes, return an error</li>
<li>no_temp_file: read the uploded file in memory without any temp files</li>
<li>{temp_file,FullFilePath}: Specify full path for the temp file. If not given, a unique file name is generated</li>
<li>{temp_dir, TempDir} : Specify a directory to store uploaded temp file. By default &#39;/tmp&#39; is used.</li>
</ol>
</li>
</ol>
<p>Using it is simple. Just call <strong>read_multipart_form</strong> from your &#39;<strong>out</strong>&#39; function and it&#39;ll return a tuple with first element either &#39;get_more&#39;, &#39;done&#39; or &#39;error&#39;. The &#39;get_more&#39; implies more data needs to be read and you must call read_multipart_form again. &#39;done&#39; implies it&#39;s done reading all parameters and you&#39;re free to proceed. The &#39;done&#39; tuple also returns a &#39;dict&#39; full of params. This dict can be queried for parameters by name. For file upload parameters it returns one of the following lists:</p>

<div class="wp_syntax"><div class="code"><pre class="erlang" style="font-family:monospace;"><span style="color: #109ab8;">&#91;</span><span style="color: #109ab8;">&#123;</span>filename<span style="color: #6bb810;">,</span> <span style="color: #ff7800;">&quot;name of the uploaded file as entered on the form&quot;</span><span style="color: #109ab8;">&#125;</span><span style="color: #6bb810;">,</span>
  <span style="color: #109ab8;">&#123;</span>value<span style="color: #6bb810;">,</span> <span style="color: #45b3e6;">Contents_of_the_file_all_in_memory</span><span style="color: #109ab8;">&#125;</span><span style="color: #109ab8;">&#93;</span>
<span style="color: #45b3e6;">OR</span>
<span style="color: #109ab8;">&#91;</span><span style="color: #109ab8;">&#123;</span>filename<span style="color: #6bb810;">,</span> <span style="color: #ff7800;">&quot;name of the uploaded file as entered on the form&quot;</span><span style="color: #109ab8;">&#125;</span><span style="color: #6bb810;">,</span>
  <span style="color: #109ab8;">&#123;</span>temp_file<span style="color: #6bb810;">,</span> <span style="color: #ff7800;">&quot;full pathname of the temp file&quot;</span><span style="color: #109ab8;">&#125;</span><span style="color: #109ab8;">&#93;</span></pre></div></div>

<p>In the second case, it&#39;s your responsibility to remove the temp file. <strong>Usage example:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="erlang" style="font-family:monospace;"><span style="color: #014ea4;">-</span><span style="color: #5400b3;">module</span><span style="color: #109ab8;">&#40;</span>my_yaws_controller<span style="color: #109ab8;">&#41;</span><span style="color: #6bb810;">.</span>
<span style="color: #014ea4;">-</span><span style="color: #5400b3;">export</span><span style="color: #109ab8;">&#40;</span><span style="color: #109ab8;">&#91;</span>out<span style="color: #014ea4;">/</span><span style="color: #ff9600;">1</span><span style="color: #109ab8;">&#93;</span><span style="color: #109ab8;">&#41;</span><span style="color: #6bb810;">.</span>
&nbsp;
<span style="color: #ff3c00;">out</span><span style="color: #109ab8;">&#40;</span><span style="color: #45b3e6;">Arg</span><span style="color: #109ab8;">&#41;</span> <span style="color: #6bb810;">-&gt;</span>
     <span style="color: #45b3e6;">Options</span> <span style="color: #014ea4;">=</span> <span style="color: #109ab8;">&#91;</span>no_temp_file<span style="color: #109ab8;">&#93;</span><span style="color: #6bb810;">,</span>
     <span style="color: #186895;">case</span> yaws_multipart:<span style="color: #ff3c00;">read_multipart_form</span><span style="color: #109ab8;">&#40;</span><span style="color: #45b3e6;">Arg</span><span style="color: #6bb810;">,</span> <span style="color: #45b3e6;">Options</span><span style="color: #109ab8;">&#41;</span> <span style="color: #186895;">of</span>
             <span style="color: #109ab8;">&#123;</span>done<span style="color: #6bb810;">,</span> <span style="color: #45b3e6;">Params</span><span style="color: #109ab8;">&#125;</span> <span style="color: #6bb810;">-&gt;</span> 
                   <span style="color: #ff4e18;">io</span>:<span style="color: #ff3c00;">format</span><span style="color: #109ab8;">&#40;</span><span style="color: #ff7800;">&quot;Params : ~p&quot;</span><span style="color: #6bb810;">,</span><span style="color: #109ab8;">&#91;</span><span style="color: #45b3e6;">Params</span><span style="color: #109ab8;">&#93;</span><span style="color: #109ab8;">&#41;</span><span style="color: #6bb810;">,</span>
                   <span style="color: #109ab8;">&#91;</span><span style="color: #109ab8;">&#123;</span>filename<span style="color: #6bb810;">,</span> <span style="color: #45b3e6;">File_name</span><span style="color: #109ab8;">&#125;</span><span style="color: #6bb810;">,</span><span style="color: #109ab8;">&#123;</span>value<span style="color: #6bb810;">,</span><span style="color: #45b3e6;">File_content</span><span style="color: #109ab8;">&#125;</span><span style="color: #109ab8;">&#93;</span> <span style="color: #014ea4;">=</span> <span style="color: #ff4e18;">dict</span>:<span style="color: #ff3c00;">find</span><span style="color: #109ab8;">&#40;</span><span style="color: #ff7800;">&quot;my_file&quot;</span><span style="color: #6bb810;">,</span> <span style="color: #45b3e6;">Params</span><span style="color: #109ab8;">&#41;</span><span style="color: #6bb810;">,</span>
                  <span style="color: #45b3e6;">Another_param</span> <span style="color: #014ea4;">=</span> <span style="color: #ff4e18;">dict</span>:<span style="color: #ff3c00;">find</span><span style="color: #109ab8;">&#40;</span><span style="color: #ff7800;">&quot;another_param&quot;</span><span style="color: #6bb810;">,</span> <span style="color: #45b3e6;">Params</span><span style="color: #109ab8;">&#41;</span><span style="color: #6bb810;">;</span>
                  <span style="color: #666666; font-style: italic;">% do something with File_name, File_content and Another_param</span>
              <span style="color: #109ab8;">&#123;</span>error<span style="color: #6bb810;">,</span> <span style="color: #45b3e6;">Reason</span><span style="color: #109ab8;">&#125;</span> <span style="color: #6bb810;">-&gt;</span>
                   <span style="color: #ff4e18;">io</span>:<span style="color: #ff3c00;">format</span><span style="color: #109ab8;">&#40;</span><span style="color: #ff7800;">&quot;Error reading multipart form: ~s&quot;</span><span style="color: #6bb810;">,</span> <span style="color: #109ab8;">&#91;</span><span style="color: #45b3e6;">Reason</span><span style="color: #109ab8;">&#93;</span><span style="color: #109ab8;">&#41;</span><span style="color: #6bb810;">;</span>
              <span style="color: #45b3e6;">Other</span> <span style="color: #6bb810;">-&gt;</span> <span style="color: #45b3e6;">Other</span>
      <span style="color: #186895;">end</span>
<span style="color: #6bb810;">.</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blogs.yellowfish.biz/2009/yaws-and-file-upload/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Website Postion vs. Sales Prospecting</title>
		<link>http://blogs.yellowfish.biz/2009/website-postion-vs-sales-prospecting/</link>
		<comments>http://blogs.yellowfish.biz/2009/website-postion-vs-sales-prospecting/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 16:30:17 +0000</pubDate>
		<dc:creator>Lori Barkyoumb</dc:creator>
				<category><![CDATA[Web Presence]]></category>
		<category><![CDATA[Website Design]]></category>
		<category><![CDATA[business approach]]></category>
		<category><![CDATA[consultant]]></category>
		<category><![CDATA[delivering information]]></category>
		<category><![CDATA[online sales]]></category>
		<category><![CDATA[online search]]></category>
		<category><![CDATA[online service]]></category>
		<category><![CDATA[online services]]></category>
		<category><![CDATA[sales methods]]></category>
		<category><![CDATA[sales prospecting]]></category>
		<category><![CDATA[selling online]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[website design]]></category>
		<category><![CDATA[website optimization]]></category>
		<category><![CDATA[website SEO]]></category>
		<category><![CDATA[win customers]]></category>

		<guid isPermaLink="false">http://blogs.yellowfish.biz/?p=154</guid>
		<description><![CDATA[It&#8217;s hard for a business to survive today.  This has caused lot&#8217;s of companies to incorporate practically any method of prospecting new business such as constant cold calls, daily eblast, ineffectively designed direct mail, etc..
With a rapid fire of  sales genres being applied in attempt to win customers, the buyer is steadily becoming desensitized and [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s hard for a business to survive today.  This has caused lot&#8217;s of companies to incorporate practically any method of prospecting new business such as constant cold calls, daily eblast, ineffectively designed direct mail, etc..</p>
<p>With a rapid fire of  sales genres being applied in attempt to win customers, the buyer is steadily becoming desensitized and blocking most of this crap out. The buyer knows they can just google a service / product  if they need to and become annoyed at the unwelcome sales contact. Obviously this leaves a bad taste in their mouth. In the end the buyer will be the one to approach a business should they decide to and only if the business is deemed worthy.</P></p>
<p>That&#8217;s why it&#8217;s super important that you have a <a href="http://www.yellowfish.biz/software-development/website-importance-of-site.html">professional web presence</a> built and are positioned and ready to allow the buyer/searcher to find you first instead of you calling them. With most people starting their search for products or services on the web, they can do the research and check out places <em>before</em> they dive in and make contact.  Make sure your <a href="http://www.yellowfish.biz/software-development/website-design.html">website</a> is in good position out there delivering the information the searcher/buyer is looking to find.</P></p>
<p>When these buyers contact you via website, they  already know what you do and how you can help them.  By letting the prospect approach you, their perception of you is different. You will be a consultant to them, not a pesky peddler with unwanted goods that were not asked for.  That alone gives you a good chance at selling to them and gains you instant respect.</p>
<p>Think of  positioning your website vs. prospecting this way;  if you needed a doctor, you would research and choose one you felt comfortable with.  You probably wouldn&#8217;t choose the prospecting doctor who happen to call you at breakfast one week wondering if you had a migrane headache they could help with nor would you choose the prospecting doctor who sent you a flyer in the mail offering a significant new patient discount that expires in two weeks.</p>
<p>What it boils down to is the doctor doesn&#8217;t find the patient, the patient find them. This creates the patient confidence to accept the diagnosis and follow recommended orders no matter how inconvenient or painful.</p>
<p>Get competitive and make sure your <a href="http://www.yellowfish.biz/software-development/website-design.html">website</a> is out there and ready to be found when these potential customers start their research. Lastly, make sure your website is delivering information that will help the visitor get started, then want to contact you to learn more. That is website positioning, not prospecting.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.yellowfish.biz/2009/website-postion-vs-sales-prospecting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What are your business goals for your website?</title>
		<link>http://blogs.yellowfish.biz/2009/what-are-your-business-goals-for-your-website/</link>
		<comments>http://blogs.yellowfish.biz/2009/what-are-your-business-goals-for-your-website/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 13:56:13 +0000</pubDate>
		<dc:creator>Lori Barkyoumb</dc:creator>
				<category><![CDATA[Website Design]]></category>
		<category><![CDATA[business goals]]></category>
		<category><![CDATA[business tools]]></category>
		<category><![CDATA[online search]]></category>
		<category><![CDATA[web design tools]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[web goals]]></category>
		<category><![CDATA[Web Presence]]></category>
		<category><![CDATA[web project]]></category>
		<category><![CDATA[web-design]]></category>
		<category><![CDATA[website goals]]></category>

		<guid isPermaLink="false">http://blogs.yellowfish.biz/?p=125</guid>
		<description><![CDATA[When considering your business website it&#8217;s best to think in terms of business goals you would like to achieve with your website. Your website is the front door of your business. Most people start searching for services and products these days on the web, then contact you in person or visit your physical location. With [...]]]></description>
			<content:encoded><![CDATA[<p>When considering your business website it&#8217;s best to think in terms of business goals you would like to achieve with your website. Your website is the front door of your business. Most people start searching for services and products these days on the web, then contact you in person or visit your physical location. With this in mind, think of what business goals you would like your website to meet as it is your first impression.  It&#8217;s the best business tool you&#8217;ve got, make it work hard for you and make it speak to your visitors.</p>
<p>Some business goals to consider (think in terms of a year from now, 2 years from now) when determining your website goals are:</p>
<p>What do you want your website to do for you AND the visitor?</p>
<ol>
<li>Inform</li>
<li>Inspire Awareness</li>
<li>Educate</li>
<li>Repeat Visitors</li>
<li>User Interaction</li>
<li>Media source</li>
<li>Resources</li>
<li>Measurement</li>
<li>Call-to-actions</li>
<li>Funding/ donations</li>
<li>Grow Rep &amp; Branding</li>
</ol>
<p>Qualitive Goals:</p>
<ol>
<li>Market Position</li>
<li>Kind of Business</li>
<li>Target Audience/ Market</li>
</ol>
<p>Potential conflicts of business goals (if any):</p>
<p>Other Goals:</p>
<p>Other Challenges:</p>
<p>Once you have this handly list populated, a web designer will have a great tool to design a website that will  accommodate these needs. It&#8217;s truly helpful.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.yellowfish.biz/2009/what-are-your-business-goals-for-your-website/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
