<?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>Bottom Up Design</title>
	<atom:link href="http://bottomupdesign.net/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://bottomupdesign.net</link>
	<description>&#34;changing the language to suit the problem&#34;</description>
	<lastBuildDate>Wed, 31 Mar 2010 15:43:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>have a .properties file and need to use it in grails?</title>
		<link>http://bottomupdesign.net/?p=138</link>
		<comments>http://bottomupdesign.net/?p=138#comments</comments>
		<pubDate>Wed, 31 Mar 2010 15:43:54 +0000</pubDate>
		<dc:creator>Jonathan Chauncey</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://bottomupdesign.net/?p=138</guid>
		<description><![CDATA[Stick in the the src/java directory and it will automagically get copied over to the web-inf directory in project directory of your .grails folder.
]]></description>
			<content:encoded><![CDATA[<p>Stick in the the src/java directory and it will automagically get copied over to the web-inf directory in project directory of your .grails folder.</p>
]]></content:encoded>
			<wfw:commentRss>http://bottomupdesign.net/?feed=rss2&amp;p=138</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>changing the deployment context of an app in grails</title>
		<link>http://bottomupdesign.net/?p=136</link>
		<comments>http://bottomupdesign.net/?p=136#comments</comments>
		<pubDate>Tue, 30 Mar 2010 14:33:39 +0000</pubDate>
		<dc:creator>Jonathan Chauncey</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://bottomupdesign.net/?p=136</guid>
		<description><![CDATA[So I found this blog post which describes how to change the deployment context of an app in grails. 
Essentially you add app.context = /yourcontext to the application.properties file which is located in the root directory. Pretty easy eh?
]]></description>
			<content:encoded><![CDATA[<p>So I found <a href="http://mrhaki.blogspot.com/2009/12/grails-goodness-change-context-path-of.html">this</a> blog post which describes how to change the deployment context of an app in grails. </p>
<p>Essentially you add app.context = /yourcontext to the application.properties file which is located in the root directory. Pretty easy eh?</p>
]]></content:encoded>
			<wfw:commentRss>http://bottomupdesign.net/?feed=rss2&amp;p=136</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>interview questions&#8230;</title>
		<link>http://bottomupdesign.net/?p=128</link>
		<comments>http://bottomupdesign.net/?p=128#comments</comments>
		<pubDate>Fri, 05 Mar 2010 18:02:17 +0000</pubDate>
		<dc:creator>Jonathan Chauncey</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://bottomupdesign.net/?p=128</guid>
		<description><![CDATA[So yesterday I had a phone interview with Rally. Overall, I think the interview went good, but one question he asked me was about polymorphism &#8211; &#8220;What is polymorphism?&#8221; to be exact.
We all learn about polymorphism in college along with things like multiple inheritance, weak/strong typing, and object oriented design. But I have always found [...]]]></description>
			<content:encoded><![CDATA[<p>So yesterday I had a phone interview with <a href="http://rallydev.com">Rally</a>. Overall, I think the interview went good, but one question he asked me was about polymorphism &#8211; &#8220;What is polymorphism?&#8221; to be exact.</p>
<p>We all learn about polymorphism in college along with things like multiple inheritance, weak/strong typing, and object oriented design. But I have always found questions involving these concepts have really funky answers that are sometimes hard to articulate. My first reaction was to say that polymorphism is having a class Foo that can act like class Bar. Well that&#8217;s not technically the right answer, but I am not sure its necessarily the wrong answer as well.</p>
<p>Polymorphism is defined in my CS3410 book (Data Structures and Problem Solving using Java &#8211; second edition by Mark Weiss) as the following &#8211; </p>
<blockquote><p>A reference type can refence objects of several different types. When methods are applied to the polymorphic type, the operation that is appropriate to the actual referenced object is automatically selected. In Java, this is implemented as part of inheritance. Polymorphism allows us to implement classes that share common logic. </p></blockquote>
<p>So if Student and Faculty both extend Person and you assign a newly created Student object to a Person reference and then call toString(), it will use the Student&#8217;s toString method and not the Person class method (that is unless the Student toString calls super.toString()). The appropriate implementation of the method is called at run-time through <a href="http://en.wikipedia.org/wiki/Dynamic_binding_%28computer_science%29">dynamic binding</a>.</p>
<p>So that means that a Person class can indeed act like a Student class and vice-versa depending on the methods called.</p>
<p>Oh and another question he asked was what is the difference between a list and a set? This one always screws me up, I get them backwards 9 times out of 10. So here are the answers:</p>
<p>List &#8211; Can have duplicates and has a defined order.<br />
Set &#8211; Cannot have duplicates and does not have a defined order. </p>
]]></content:encoded>
			<wfw:commentRss>http://bottomupdesign.net/?feed=rss2&amp;p=128</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Grails &#8211; DomainObject.findAll() does not presort returned objects&#8230;</title>
		<link>http://bottomupdesign.net/?p=124</link>
		<comments>http://bottomupdesign.net/?p=124#comments</comments>
		<pubDate>Mon, 01 Mar 2010 18:25:25 +0000</pubDate>
		<dc:creator>Jonathan Chauncey</dc:creator>
				<category><![CDATA[grails]]></category>

		<guid isPermaLink="false">http://bottomupdesign.net/?p=124</guid>
		<description><![CDATA[So I have a drop down list of Applications&#8230; Well the Applications domain object specifies that it should presort all returns by the appName field. This works great when doing something like user.applications. Yet when I did my normal Application.findAll() the list it returned was not sorted by appName. I instead had to use Application.list(). [...]]]></description>
			<content:encoded><![CDATA[<p>So I have a drop down list of Applications&#8230; Well the Applications domain object specifies that it should presort all returns by the appName field. This works great when doing something like user.applications. Yet when I did my normal Application.findAll() the list it returned was not sorted by appName. I instead had to use Application.list(). </p>
]]></content:encoded>
			<wfw:commentRss>http://bottomupdesign.net/?feed=rss2&amp;p=124</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>D6T-XL</title>
		<link>http://bottomupdesign.net/?p=119</link>
		<comments>http://bottomupdesign.net/?p=119#comments</comments>
		<pubDate>Tue, 09 Feb 2010 17:00:33 +0000</pubDate>
		<dc:creator>Jonathan Chauncey</dc:creator>
				<category><![CDATA[photography]]></category>

		<guid isPermaLink="false">http://bottomupdesign.net/?p=119</guid>
		<description><![CDATA[The monthly assignment over on the Fred Miranada forums is &#8220;New&#8221; well here is my take on new. Oh the retail price of this bad boy is about $300,000.


]]></description>
			<content:encoded><![CDATA[<p>The monthly assignment over on the <a href="http://www.fredmiranda.com/forum/">Fred Miranada forums</a> is &#8220;New&#8221; well here is my take on new. Oh the retail price of this bad boy is about $300,000.</p>
<p><img src="http://lh5.ggpht.com/_ZTBWlHsjYBU/S3Fw69hAlPI/AAAAAAAAATs/rCMydsp6p2E/s800/CAT-D6TXL-2.jpg" alt="D6T-XL" /></p>
<p><img src="http://lh4.ggpht.com/_ZTBWlHsjYBU/S3Fw74dv4QI/AAAAAAAAAT0/w3XyNah7Nyw/s800/CAT-D6TXL-1.jpg" alt="D6T-XL" /></p>
]]></content:encoded>
			<wfw:commentRss>http://bottomupdesign.net/?feed=rss2&amp;p=119</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSO take 2</title>
		<link>http://bottomupdesign.net/?p=113</link>
		<comments>http://bottomupdesign.net/?p=113#comments</comments>
		<pubDate>Wed, 03 Feb 2010 18:09:44 +0000</pubDate>
		<dc:creator>Jonathan Chauncey</dc:creator>
				<category><![CDATA[grails]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://bottomupdesign.net/?p=113</guid>
		<description><![CDATA[Ok so we purchased a new template from Theme Forest this week for our &#8220;ASM&#8221; system. So while I was reskinning the login box I started having issues outputting the html dynamically using jquery (the old box as you can see was rather simple). So I decided to iframe the entire modal window of the [...]]]></description>
			<content:encoded><![CDATA[<p>Ok so we purchased a new template from <a href="http://www.themeforest.net">Theme Forest</a> this week for our &#8220;ASM&#8221; system. So while I was reskinning the login box I started having issues outputting the html dynamically using jquery (the old box as you can see was rather simple). So I decided to iframe the entire modal window of the login box. The reason I ended up not doing this last time was because redirecting once authenticated was a bit of pain for some reason. But alas I have conquered that beast. </p>
<p>So what you end up with is something like this:</p>
<p>This is the page which needs to display a login box</p>
<div class="codecolorer-container html4strict blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #808080; font-style: italic;">&lt;!--</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp;To change this template, choose Tools | Templates</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp;and open the template in the editor.</span><br />
<span style="color: #808080; font-style: italic;">--&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">meta</span> <span style="color: #000066;">http-equiv</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Content-Type&quot;</span> <span style="color: #000066;">content</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/html; charset=UTF-8&quot;</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">title</span>&gt;</span>FDLE:AppHub<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">title</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/AppHub/login/script&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/AppHub/js/jquery-1.3.2.min.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span> <br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/AppHub/js/jquery-ui-1.7.2.custom.min.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span> <br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; loadIFrameModal('local', window.location.protocol+&quot;//&quot;+window.location.host+&quot;/AppHub/login/show/&quot;);<br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span>&gt;</span><br />
<br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></div></td></tr></tbody></table></div>
<p>The javascript (which is a GSP page)</p>
<div class="codecolorer-container javascript blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">function</span> loadIFrameModal<span style="color: #009900;">&#40;</span>env<span style="color: #339933;">,</span> targetUrl<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; $<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">load</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> flag <span style="color: #339933;">=</span> $<span style="color: #009900;">&#123;</span>flag<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>flag <span style="color: #339933;">==</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>env <span style="color: #339933;">==</span> <span style="color: #3366CC;">'dev'</span> <span style="color: #339933;">||</span> env <span style="color: #339933;">==</span> <span style="color: #3366CC;">'development'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;body&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;div id=<span style="color: #000099; font-weight: bold;">\&quot;</span>modal<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;/div&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#modal&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;iframe src=<span style="color: #000099; font-weight: bold;">\&quot;</span>http://162.143.99.200:8080/AppHub/login/?targetUrl=&quot;</span><span style="color: #339933;">+</span>targetUrl<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span> height=<span style="color: #000099; font-weight: bold;">\&quot;</span>500<span style="color: #000099; font-weight: bold;">\&quot;</span> width=<span style="color: #000099; font-weight: bold;">\&quot;</span>400<span style="color: #000099; font-weight: bold;">\&quot;</span> frameborder=<span style="color: #000099; font-weight: bold;">\&quot;</span>0<span style="color: #000099; font-weight: bold;">\&quot;</span> /&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>env <span style="color: #339933;">==</span> <span style="color: #3366CC;">'local'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;body&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;div id=<span style="color: #000099; font-weight: bold;">\&quot;</span>modal<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;/div&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#modal&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;iframe src=<span style="color: #000099; font-weight: bold;">\&quot;</span>http://66869-irm:8080/AppHub/login/?targetUrl=&quot;</span><span style="color: #339933;">+</span>targetUrl<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span> height=<span style="color: #000099; font-weight: bold;">\&quot;</span>475<span style="color: #000099; font-weight: bold;">\&quot;</span> width=<span style="color: #000099; font-weight: bold;">\&quot;</span>400<span style="color: #000099; font-weight: bold;">\&quot;</span> frameborder=<span style="color: #000099; font-weight: bold;">\&quot;</span>0<span style="color: #000099; font-weight: bold;">\&quot;</span> /&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">//open dialog</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#modal&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">dialog</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; autoOpen<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; height<span style="color: #339933;">:</span> <span style="color: #CC0000;">525</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; width<span style="color: #339933;">:</span> <span style="color: #CC0000;">475</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; modal<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; resizable<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; position<span style="color: #339933;">:</span> <span style="color: #3366CC;">'center'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; draggable<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; closeOnEscape<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">false</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">//hide the title bar</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.ui-dialog-titlebar&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#modal &gt; iframe&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;style&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;overflow:hidden;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;body&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;form id=<span style="color: #000099; font-weight: bold;">\&quot;</span>form<span style="color: #000099; font-weight: bold;">\&quot;</span> method=<span style="color: #000099; font-weight: bold;">\&quot;</span>POST<span style="color: #000099; font-weight: bold;">\&quot;</span> action=<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #339933;">+</span>targetUrl<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;/form&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#form&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;input type=<span style="color: #000099; font-weight: bold;">\&quot;</span>hidden<span style="color: #000099; font-weight: bold;">\&quot;</span> name=<span style="color: #000099; font-weight: bold;">\&quot;</span>id<span style="color: #000099; font-weight: bold;">\&quot;</span> value=<span style="color: #000099; font-weight: bold;">\&quot;</span>${id}<span style="color: #000099; font-weight: bold;">\&quot;</span> /&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#form&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;input type=<span style="color: #000099; font-weight: bold;">\&quot;</span>hidden<span style="color: #000099; font-weight: bold;">\&quot;</span> name=<span style="color: #000099; font-weight: bold;">\&quot;</span>ip<span style="color: #000099; font-weight: bold;">\&quot;</span> value=<span style="color: #000099; font-weight: bold;">\&quot;</span>${request.getRemoteAddr()}<span style="color: #000099; font-weight: bold;">\&quot;</span> /&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#form&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">submit</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>The iframe content:</p>
<div class="codecolorer-container html4strict blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br />71<br />72<br />73<br />74<br />75<br />76<br />77<br />78<br />79<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!-- Start Wrap --&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;wrap&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;login&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;content&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;inner&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">noscript</span>&gt;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!-- Show message when javascript is not enabled --&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;message error&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>Javascript is needed for this template to work properly. <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span>Please <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://browsehappy.com/&quot;</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Upgrade to a better browser&quot;</span>&gt;</span>upgrade<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span> your browser or <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.google.com/support/bin/answer.py?answer=23852&quot;</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Enable Javascript in your browser&quot;</span>&gt;</span>enable<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span> Javascript to navigate the interface properly.<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>&nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">noscript</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!-- Start Content Box #1 --&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;title&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h3</span>&gt;</span>fdle:Connect<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h3</span>&gt;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;selector&quot;</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;content_box&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;tab active&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;tab-login&quot;</span>&gt;</span>Login<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;tab&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;tab-password&quot;</span>&gt;</span>Forgotten Password<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;box&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;txt&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;content_box&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;tab-login&quot;</span>&gt;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!-- Start Message --&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;g:eachError bean<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;${loginCmd}&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;message error&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;&lt;g:message error<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;${it}&quot;</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>g:eachError&gt;</span>&nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!-- End Message --&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!-- Start Login Form --&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;g:form <span style="color: #000066;">action</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;signIn&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">fieldset</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">label</span>&gt;</span>Username<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">label</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;txt-input large&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;username&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">label</span>&gt;</span>Password<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">label</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;password&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;txt-input large&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;password&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;float:left;&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;submit&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;submit&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Login&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;reset&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;reset&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;reset&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Reset&quot;</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;hidden&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;targetUrl&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;${targetUrl}&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;hidden&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;ip&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;${request.getRemoteAddr()}&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">fieldset</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>g:form&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!-- End Login Form --&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;tab-password&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!-- Start Password Form --&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">form</span> <span style="color: #000066;">method</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;post&quot;</span> <span style="color: #000066;">action</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;index.html&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">fieldset</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">label</span>&gt;</span>Email<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">label</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;txt-input large&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">small</span>&gt;</span>Please enter the email address of your account<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">small</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;submit&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;submit&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Request Password&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">fieldset</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">form</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!-- End Password Form --&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!-- End Content Box #1 --&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span> <br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!-- End Wrap --&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span></div></td></tr></tbody></table></div>
<p>And the page that redirects once authenticated:</p>
<div class="codecolorer-container html4strict blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #808080; font-style: italic;">&lt;!--</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp;To change this template, choose Tools | Templates</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp;and open the template in the editor.</span><br />
<span style="color: #808080; font-style: italic;">--&gt;</span><br />
<br />
<span style="color: #009900;">&lt;%@ page contentType<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/html;charset=UTF-8&quot;</span> %&gt;</span><br />
<span style="color: #00bbdd;">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span> xmlns<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.w3.org/1999/xhtml&quot;</span>&gt;</span><br />
&nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">meta</span> <span style="color: #000066;">http-equiv</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Content-Type&quot;</span> <span style="color: #000066;">content</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/html; charset=UTF-8&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">title</span>&gt;</span>FDLE:Connect<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">title</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.google.com/jsapi&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span> <br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; // Load jQuery<br />
&nbsp; &nbsp; &nbsp; google.load(&quot;jquery&quot;, &quot;1.3.2&quot;);<br />
&nbsp; &nbsp; &nbsp; google.load(&quot;jqueryui&quot;, &quot;1.7.2&quot;);<br />
&nbsp; &nbsp; &nbsp; google.setOnLoadCallback(function() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $(document).ready(function() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; self.parent.location = '${targetUrl}'; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; });<br />
&nbsp; &nbsp; &nbsp; });<br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span><br />
&nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span><br />
&nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;color:#000; font-size:14px; font-family:verdana;&quot;</span>&gt;</span>If this page does not redirect please click the following <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;${targetUrl}&quot;</span> <span style="color: #000066;">target</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;_top&quot;</span>&gt;</span>link<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>.<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span></span><br />
<span style="color: #009900;"> &nbsp;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://bottomupdesign.net/?feed=rss2&amp;p=113</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Implementing Single Sign On&#8230;</title>
		<link>http://bottomupdesign.net/?p=103</link>
		<comments>http://bottomupdesign.net/?p=103#comments</comments>
		<pubDate>Wed, 20 Jan 2010 14:02:40 +0000</pubDate>
		<dc:creator>Jonathan Chauncey</dc:creator>
				<category><![CDATA[REST]]></category>
		<category><![CDATA[grails]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://bottomupdesign.net/?p=103</guid>
		<description><![CDATA[So when I set out to rewrite our ASM system, I knew I had to find some selling points to the architecture I was pitching. One of them was the ability to write an SSO system that was easy and efficient and most of all did not require much code for implementing applications (JSSO and [...]]]></description>
			<content:encoded><![CDATA[<p>So when I set out to rewrite our ASM system, I knew I had to find some selling points to the architecture I was pitching. One of them was the ability to write an SSO system that was easy and efficient and most of all did not require much code for implementing applications (JSSO and the like were out of the question).</p>
<p>So here&#8217;s what I came up with (everything is written in Grails)&#8230; I first created an AuthController which would handle the authentication and return back a user id for the person if they were a valid user (either in our custom user store or our AD system). This controller had a login action which displayed the login prompt and would return all the necessary error back to the user if something was wrong.</p>
<p>I then wrote another action whose corresponding GSP stored my javascript for creating the needed iframes on the page. This meant that when someone loaded the action I could access all of their cookies (which I needed for SSO) even if their application was on another domain. In the action I would process the cookies and either send them the login page or return the user id back to the browser which would then be processed by the application.</p>
<p>In the end the only code the implementing applications need to have is the follow:</p>
<div class="codecolorer-container html4strict blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.google.com/jsapi&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span><br />
&nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://localhost:8080/AppHub/auth/script&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span><br />
&nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span>&gt;</span><br />
&nbsp; &nbsp; // Load jQuery<br />
&nbsp; &nbsp; google.load(&quot;jquery&quot;, &quot;1.3.2&quot;);<br />
&nbsp; &nbsp; google.load(&quot;jqueryui&quot;, &quot;1.7.2&quot;);<br />
&nbsp; &nbsp; google.setOnLoadCallback(function() {<br />
&nbsp; &nbsp; &nbsp; loadModal('local',<br />
&nbsp; &nbsp; &nbsp; window.location.protocol+&quot;//&quot;+window.location.host+&quot;/LoginApplication/login/show/&quot;,<br />
&nbsp; &nbsp; &nbsp; window.location.protocol+&quot;//&quot;+window.location.host+window.location.pathname);<br />
&nbsp; &nbsp; });<br />
&nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span></div></td></tr></tbody></table></div>
<p>And here is how I process the script action:</p>
<div class="codecolorer-container groovy blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br /></div></td><td><div class="groovy codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">def</span> script <span style="color: #66cc66;">=</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">def</span> cookie <span style="color: #66cc66;">=</span> request.<span style="color: #006600;">cookies</span>.<span style="color: #663399;">find</span> <span style="color: #66cc66;">&#123;</span> it.<span style="color: #006600;">name</span> <span style="color: #66cc66;">==</span> <span style="color: #ff0000;">'session_id'</span> <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">!</span>cookie<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; render<span style="color: #66cc66;">&#40;</span>view: <span style="color: #ff0000;">&quot;script&quot;</span>, contentType: <span style="color: #ff0000;">&quot;text/javascript&quot;</span>, model: <span style="color: #66cc66;">&#91;</span>flag: <span style="color: #ff0000;">'false'</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">def</span> id <span style="color: #66cc66;">=</span> Session.<span style="color: #006600;">findBySessionIdAndKey</span><span style="color: #66cc66;">&#40;</span>cookie.<span style="color: #006600;">value</span>, <span style="color: #ff0000;">&quot;id&quot;</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>id <span style="color: #66cc66;">&amp;&amp;</span> cookie.<span style="color: #006600;">value</span> <span style="color: #66cc66;">==</span> id.<span style="color: #006600;">sessionId</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; render<span style="color: #66cc66;">&#40;</span>view: <span style="color: #ff0000;">&quot;script&quot;</span>, contentType: <span style="color: #ff0000;">&quot;text/javascript&quot;</span>, model: <span style="color: #66cc66;">&#91;</span>flag: <span style="color: #ff0000;">'true'</span>, id: id.<span style="color: #006600;">value</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; cookie.<span style="color: #006600;">maxAge</span> <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">0</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; response.<span style="color: #006600;">addCookie</span><span style="color: #66cc66;">&#40;</span>cookie<span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; render<span style="color: #66cc66;">&#40;</span>view: <span style="color: #ff0000;">&quot;script&quot;</span>, contentType: <span style="color: #ff0000;">&quot;text/javascript&quot;</span>, model: <span style="color: #66cc66;">&#91;</span>flag: <span style="color: #ff0000;">'false'</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; <span style="color: #66cc66;">&#125;</span></div></td></tr></tbody></table></div>
<p>And here is the script.gsp</p>
<div class="codecolorer-container javascript blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br />71<br />72<br />73<br />74<br />75<br />76<br />77<br />78<br />79<br />80<br />81<br />82<br />83<br />84<br />85<br />86<br />87<br />88<br />89<br />90<br />91<br />92<br />93<br />94<br />95<br />96<br />97<br />98<br />99<br />100<br />101<br />102<br />103<br />104<br />105<br />106<br />107<br />108<br />109<br />110<br />111<br />112<br />113<br />114<br />115<br />116<br />117<br />118<br />119<br />120<br />121<br />122<br />123<br />124<br />125<br />126<br />127<br />128<br />129<br />130<br />131<br />132<br />133<br />134<br />135<br />136<br />137<br />138<br />139<br />140<br />141<br />142<br />143<br />144<br />145<br />146<br />147<br />148<br />149<br />150<br />151<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">function</span> loadModal<span style="color: #009900;">&#40;</span>env<span style="color: #339933;">,</span> targetUrl<span style="color: #339933;">,</span> returnUrl<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; <span style="color: #003366; font-weight: bold;">var</span> flag <span style="color: #339933;">=</span> $<span style="color: #009900;">&#123;</span>flag<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span><br />
&nbsp; $<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">load</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>flag <span style="color: #339933;">==</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>env <span style="color: #339933;">==</span> <span style="color: #3366CC;">'dev'</span> <span style="color: #339933;">||</span> env <span style="color: #339933;">==</span> <span style="color: #3366CC;">'development'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;head&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;link rel=<span style="color: #000099; font-weight: bold;">\&quot;</span>stylesheet<span style="color: #000099; font-weight: bold;">\&quot;</span> href=<span style="color: #000099; font-weight: bold;">\&quot;</span>http://162.143.99.200:8080/AppHub/css/ui-darkness/jquery-ui-1.7.2.custom.css<span style="color: #000099; font-weight: bold;">\&quot;</span> type=<span style="color: #000099; font-weight: bold;">\&quot;</span>text/css<span style="color: #000099; font-weight: bold;">\&quot;</span> media=<span style="color: #000099; font-weight: bold;">\&quot;</span>screen<span style="color: #000099; font-weight: bold;">\&quot;</span> /&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;head&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;link rel=<span style="color: #000099; font-weight: bold;">\&quot;</span>stylesheet<span style="color: #000099; font-weight: bold;">\&quot;</span> href=<span style="color: #000099; font-weight: bold;">\&quot;</span>http://162.143.99.200:8080/AppHub/css/login.css<span style="color: #000099; font-weight: bold;">\&quot;</span> type=<span style="color: #000099; font-weight: bold;">\&quot;</span>text/css<span style="color: #000099; font-weight: bold;">\&quot;</span> media=<span style="color: #000099; font-weight: bold;">\&quot;</span>screen<span style="color: #000099; font-weight: bold;">\&quot;</span> /&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;head&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;link rel=<span style="color: #000099; font-weight: bold;">\&quot;</span>stylesheet<span style="color: #000099; font-weight: bold;">\&quot;</span> href=<span style="color: #000099; font-weight: bold;">\&quot;</span>http://162.143.99.200:8080/AppHub/css/form.css<span style="color: #000099; font-weight: bold;">\&quot;</span> type=<span style="color: #000099; font-weight: bold;">\&quot;</span>text/css<span style="color: #000099; font-weight: bold;">\&quot;</span> media=<span style="color: #000099; font-weight: bold;">\&quot;</span>screen<span style="color: #000099; font-weight: bold;">\&quot;</span> /&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;body&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;div id=<span style="color: #000099; font-weight: bold;">\&quot;</span>modal<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;/div&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#modal&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;div id=<span style="color: #000099; font-weight: bold;">\&quot;</span>box<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;/div&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#box&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;h2 style=<span style="color: #000099; font-weight: bold;">\&quot;</span>color:#666666;<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;AppHub:&lt;span class=<span style="color: #000099; font-weight: bold;">\&quot;</span>light<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;Connect&lt;/span&gt;&lt;/h2&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>hasError<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'user.username.invalid'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#box&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;p class=<span style="color: #000099; font-weight: bold;">\&quot;</span>class<span style="color: #000099; font-weight: bold;">\&quot;</span> style=<span style="color: #000099; font-weight: bold;">\&quot;</span>color:#f00;<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;strong&gt;Error:&lt;/strong&gt;&lt;g:message code=&quot;</span>user.<span style="color: #660066;">username</span>.<span style="color: #660066;">invalid</span><span style="color: #3366CC;">&quot; /&gt;&lt;/p&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>hasError<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'user.username.blank'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#box&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;p class=<span style="color: #000099; font-weight: bold;">\&quot;</span>class<span style="color: #000099; font-weight: bold;">\&quot;</span> style=<span style="color: #000099; font-weight: bold;">\&quot;</span>color:#f00;<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;strong&gt;Error:&lt;/strong&gt;&lt;g:message code=&quot;</span>user.<span style="color: #660066;">username</span>.<span style="color: #660066;">blank</span><span style="color: #3366CC;">&quot; /&gt;&lt;/p&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>hasError<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'user.password.blank'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#box&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;p class=<span style="color: #000099; font-weight: bold;">\&quot;</span>class<span style="color: #000099; font-weight: bold;">\&quot;</span> style=<span style="color: #000099; font-weight: bold;">\&quot;</span>color:#f00;<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;strong&gt;Error:&lt;/strong&gt;&lt;g:message code=&quot;</span>user.<span style="color: #660066;">password</span>.<span style="color: #660066;">blank</span><span style="color: #3366CC;">&quot; /&gt;&lt;/p&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>hasError<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'user.password.invalid'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#box&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;p class=<span style="color: #000099; font-weight: bold;">\&quot;</span>class<span style="color: #000099; font-weight: bold;">\&quot;</span> style=<span style="color: #000099; font-weight: bold;">\&quot;</span>color:#f00;<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;strong&gt;Error:&lt;/strong&gt;&lt;g:message code=&quot;</span>user.<span style="color: #660066;">password</span>.<span style="color: #660066;">invalid</span><span style="color: #3366CC;">&quot; /&gt;&lt;/p&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>hasError<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'user.adproblem'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#box&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;p class=<span style="color: #000099; font-weight: bold;">\&quot;</span>class<span style="color: #000099; font-weight: bold;">\&quot;</span> style=<span style="color: #000099; font-weight: bold;">\&quot;</span>color:#f00;<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;strong&gt;Error:&lt;/strong&gt;&lt;g:message code=&quot;</span>user.<span style="color: #660066;">adproblem</span><span style="color: #3366CC;">&quot; /&gt;&lt;/p&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>hasError<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'user.kerberos.6'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#box&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;p class=<span style="color: #000099; font-weight: bold;">\&quot;</span>class<span style="color: #000099; font-weight: bold;">\&quot;</span> style=<span style="color: #000099; font-weight: bold;">\&quot;</span>color:#f00;<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;strong&gt;Error:&lt;/strong&gt;&lt;g:message code=&quot;</span>user.<span style="color: #660066;">kerberos</span>.6<span style="color: #3366CC;">&quot; /&gt;&lt;/p&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>hasError<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'user.kerberos.18'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#box&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;p class=<span style="color: #000099; font-weight: bold;">\&quot;</span>class<span style="color: #000099; font-weight: bold;">\&quot;</span> style=<span style="color: #000099; font-weight: bold;">\&quot;</span>color:#f00;<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;strong&gt;Error:&lt;/strong&gt;&lt;g:message code=&quot;</span>user.<span style="color: #660066;">kerberos</span>.18<span style="color: #3366CC;">&quot; /&gt;&lt;/p&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>hasError<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'user.kerberos.23'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#box&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;p class=<span style="color: #000099; font-weight: bold;">\&quot;</span>class<span style="color: #000099; font-weight: bold;">\&quot;</span> style=<span style="color: #000099; font-weight: bold;">\&quot;</span>color:#f00;<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;strong&gt;Error:&lt;/strong&gt;&lt;g:message code=&quot;</span>user.<span style="color: #660066;">kerberos</span>.23<span style="color: #3366CC;">&quot; /&gt;&lt;/p&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>hasError<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'user.kerberos.24'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#box&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;p class=<span style="color: #000099; font-weight: bold;">\&quot;</span>class<span style="color: #000099; font-weight: bold;">\&quot;</span> style=<span style="color: #000099; font-weight: bold;">\&quot;</span>color:#f00;<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;strong&gt;Error:&lt;/strong&gt;&lt;g:message code=&quot;</span>user.<span style="color: #660066;">kerberos</span>.24<span style="color: #3366CC;">&quot; /&gt;&lt;/p&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#box&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;form id=<span style="color: #000099; font-weight: bold;">\&quot;</span>form<span style="color: #000099; font-weight: bold;">\&quot;</span> method=<span style="color: #000099; font-weight: bold;">\&quot;</span>POST<span style="color: #000099; font-weight: bold;">\&quot;</span> action=<span style="color: #000099; font-weight: bold;">\&quot;</span>http://162.143.99.200:8080/AppHub/auth/signIn<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;/form&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#form&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;input type=<span style="color: #000099; font-weight: bold;">\&quot;</span>hidden<span style="color: #000099; font-weight: bold;">\&quot;</span> name=<span style="color: #000099; font-weight: bold;">\&quot;</span>targetUrl<span style="color: #000099; font-weight: bold;">\&quot;</span> value=<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #339933;">+</span>targetUrl<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span> /&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#form&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;input type=<span style="color: #000099; font-weight: bold;">\&quot;</span>hidden<span style="color: #000099; font-weight: bold;">\&quot;</span> name=<span style="color: #000099; font-weight: bold;">\&quot;</span>returnUrl<span style="color: #000099; font-weight: bold;">\&quot;</span> value=<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #339933;">+</span>returnUrl<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span> /&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#form&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;input type=<span style="color: #000099; font-weight: bold;">\&quot;</span>hidden<span style="color: #000099; font-weight: bold;">\&quot;</span> name=<span style="color: #000099; font-weight: bold;">\&quot;</span>ip<span style="color: #000099; font-weight: bold;">\&quot;</span> value=<span style="color: #000099; font-weight: bold;">\&quot;</span>${request.getRemoteAddr()}<span style="color: #000099; font-weight: bold;">\&quot;</span> /&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#form&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;ul&gt;&lt;/ul&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#form &gt; ul&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;li&gt;&lt;label for=<span style="color: #000099; font-weight: bold;">\&quot;</span>username<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;Username&lt;/label&gt;&lt;div&gt;&lt;input type=<span style="color: #000099; font-weight: bold;">\&quot;</span>text<span style="color: #000099; font-weight: bold;">\&quot;</span> name=<span style="color: #000099; font-weight: bold;">\&quot;</span>username<span style="color: #000099; font-weight: bold;">\&quot;</span> class=<span style="color: #000099; font-weight: bold;">\&quot;</span>max text<span style="color: #000099; font-weight: bold;">\&quot;</span> /&gt;&lt;/div&gt;&lt;/li&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#form &gt; ul&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;li&gt;&lt;label for=<span style="color: #000099; font-weight: bold;">\&quot;</span>password<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;Password&lt;/label&gt;&lt;div&gt;&lt;input type=<span style="color: #000099; font-weight: bold;">\&quot;</span>password<span style="color: #000099; font-weight: bold;">\&quot;</span> name=<span style="color: #000099; font-weight: bold;">\&quot;</span>password<span style="color: #000099; font-weight: bold;">\&quot;</span> class=<span style="color: #000099; font-weight: bold;">\&quot;</span>max text<span style="color: #000099; font-weight: bold;">\&quot;</span> /&gt;&lt;/div&gt;&lt;/li&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#form &gt; ul&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;li&gt;&lt;input type=<span style="color: #000099; font-weight: bold;">\&quot;</span>submit<span style="color: #000099; font-weight: bold;">\&quot;</span> name=<span style="color: #000099; font-weight: bold;">\&quot;</span>submit<span style="color: #000099; font-weight: bold;">\&quot;</span> class=<span style="color: #000099; font-weight: bold;">\&quot;</span>button<span style="color: #000099; font-weight: bold;">\&quot;</span> value=<span style="color: #000099; font-weight: bold;">\&quot;</span>Sign In<span style="color: #000099; font-weight: bold;">\&quot;</span> /&gt;&lt;/li&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#form &gt; ul&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;li&gt;&lt;a style=<span style="color: #000099; font-weight: bold;">\&quot;</span>color:#0088CC;<span style="color: #000099; font-weight: bold;">\&quot;</span> href=<span style="color: #000099; font-weight: bold;">\&quot;</span>#<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;Forgot Password&lt;/a&gt;&lt;span style=<span style="color: #000099; font-weight: bold;">\&quot;</span>color:#0088CC;<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt; | &lt;/span&gt;&lt;a style=<span style="color: #000099; font-weight: bold;">\&quot;</span>color:#0088CC;<span style="color: #000099; font-weight: bold;">\&quot;</span> href=<span style="color: #000099; font-weight: bold;">\&quot;</span>#<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;Register&lt;/a&gt;&lt;span style=<span style="color: #000099; font-weight: bold;">\&quot;</span>color:#0088CC;<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt; | &lt;/span&gt;&lt;a style=<span style="color: #000099; font-weight: bold;">\&quot;</span>color:#0088CC;<span style="color: #000099; font-weight: bold;">\&quot;</span> href=<span style="color: #000099; font-weight: bold;">\&quot;</span>#<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;Unlock Account&lt;/a&gt;&lt;/li&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>env <span style="color: #339933;">==</span> <span style="color: #3366CC;">'local'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;head&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;link rel=<span style="color: #000099; font-weight: bold;">\&quot;</span>stylesheet<span style="color: #000099; font-weight: bold;">\&quot;</span> href=<span style="color: #000099; font-weight: bold;">\&quot;</span>http://localhost:8080/AppHub/css/ui-darkness/jquery-ui-1.7.2.custom.css<span style="color: #000099; font-weight: bold;">\&quot;</span> type=<span style="color: #000099; font-weight: bold;">\&quot;</span>text/css<span style="color: #000099; font-weight: bold;">\&quot;</span> media=<span style="color: #000099; font-weight: bold;">\&quot;</span>screen<span style="color: #000099; font-weight: bold;">\&quot;</span> /&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;head&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;link rel=<span style="color: #000099; font-weight: bold;">\&quot;</span>stylesheet<span style="color: #000099; font-weight: bold;">\&quot;</span> href=<span style="color: #000099; font-weight: bold;">\&quot;</span>http://localhost:8080/AppHub/css/login.css<span style="color: #000099; font-weight: bold;">\&quot;</span> type=<span style="color: #000099; font-weight: bold;">\&quot;</span>text/css<span style="color: #000099; font-weight: bold;">\&quot;</span> media=<span style="color: #000099; font-weight: bold;">\&quot;</span>screen<span style="color: #000099; font-weight: bold;">\&quot;</span> /&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;head&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;link rel=<span style="color: #000099; font-weight: bold;">\&quot;</span>stylesheet<span style="color: #000099; font-weight: bold;">\&quot;</span> href=<span style="color: #000099; font-weight: bold;">\&quot;</span>http://localhost:8080/AppHub/css/form.css<span style="color: #000099; font-weight: bold;">\&quot;</span> type=<span style="color: #000099; font-weight: bold;">\&quot;</span>text/css<span style="color: #000099; font-weight: bold;">\&quot;</span> media=<span style="color: #000099; font-weight: bold;">\&quot;</span>screen<span style="color: #000099; font-weight: bold;">\&quot;</span> /&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;body&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;div id=<span style="color: #000099; font-weight: bold;">\&quot;</span>modal<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;/div&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#modal&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;div id=<span style="color: #000099; font-weight: bold;">\&quot;</span>box<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;/div&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#box&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;h2 style=<span style="color: #000099; font-weight: bold;">\&quot;</span>color:#666666;<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;AppHub:&lt;span class=<span style="color: #000099; font-weight: bold;">\&quot;</span>light<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;Connect&lt;/span&gt;&lt;/h2&gt;&quot;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>hasError<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'user.username.invalid'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#box&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;p class=<span style="color: #000099; font-weight: bold;">\&quot;</span>class<span style="color: #000099; font-weight: bold;">\&quot;</span> style=<span style="color: #000099; font-weight: bold;">\&quot;</span>color:#f00;<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;strong&gt;Error:&lt;/strong&gt;&lt;g:message code=&quot;</span>user.<span style="color: #660066;">username</span>.<span style="color: #660066;">invalid</span><span style="color: #3366CC;">&quot; /&gt;&lt;/p&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>hasError<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'user.username.blank'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#box&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;p class=<span style="color: #000099; font-weight: bold;">\&quot;</span>class<span style="color: #000099; font-weight: bold;">\&quot;</span> style=<span style="color: #000099; font-weight: bold;">\&quot;</span>color:#f00;<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;strong&gt;Error:&lt;/strong&gt;&lt;g:message code=&quot;</span>user.<span style="color: #660066;">username</span>.<span style="color: #660066;">blank</span><span style="color: #3366CC;">&quot; /&gt;&lt;/p&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>hasError<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'user.password.blank'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#box&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;p class=<span style="color: #000099; font-weight: bold;">\&quot;</span>class<span style="color: #000099; font-weight: bold;">\&quot;</span> style=<span style="color: #000099; font-weight: bold;">\&quot;</span>color:#f00;<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;strong&gt;Error:&lt;/strong&gt;&lt;g:message code=&quot;</span>user.<span style="color: #660066;">password</span>.<span style="color: #660066;">blank</span><span style="color: #3366CC;">&quot; /&gt;&lt;/p&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>hasError<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'user.password.invalid'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#box&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;p class=<span style="color: #000099; font-weight: bold;">\&quot;</span>class<span style="color: #000099; font-weight: bold;">\&quot;</span> style=<span style="color: #000099; font-weight: bold;">\&quot;</span>color:#f00;<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;strong&gt;Error:&lt;/strong&gt;&lt;g:message code=&quot;</span>user.<span style="color: #660066;">password</span>.<span style="color: #660066;">invalid</span><span style="color: #3366CC;">&quot; /&gt;&lt;/p&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>hasError<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'user.adproblem'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#box&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;p class=<span style="color: #000099; font-weight: bold;">\&quot;</span>class<span style="color: #000099; font-weight: bold;">\&quot;</span> style=<span style="color: #000099; font-weight: bold;">\&quot;</span>color:#f00;<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;strong&gt;Error:&lt;/strong&gt;&lt;g:message code=&quot;</span>user.<span style="color: #660066;">adproblem</span><span style="color: #3366CC;">&quot; /&gt;&lt;/p&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>hasError<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'user.kerberos.6'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#box&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;p class=<span style="color: #000099; font-weight: bold;">\&quot;</span>class<span style="color: #000099; font-weight: bold;">\&quot;</span> style=<span style="color: #000099; font-weight: bold;">\&quot;</span>color:#f00;<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;strong&gt;Error:&lt;/strong&gt;&lt;g:message code=&quot;</span>user.<span style="color: #660066;">kerberos</span>.6<span style="color: #3366CC;">&quot; /&gt;&lt;/p&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>hasError<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'user.kerberos.18'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#box&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;p class=<span style="color: #000099; font-weight: bold;">\&quot;</span>class<span style="color: #000099; font-weight: bold;">\&quot;</span> style=<span style="color: #000099; font-weight: bold;">\&quot;</span>color:#f00;<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;strong&gt;Error:&lt;/strong&gt;&lt;g:message code=&quot;</span>user.<span style="color: #660066;">kerberos</span>.18<span style="color: #3366CC;">&quot; /&gt;&lt;/p&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>hasError<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'user.kerberos.23'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#box&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;p class=<span style="color: #000099; font-weight: bold;">\&quot;</span>class<span style="color: #000099; font-weight: bold;">\&quot;</span> style=<span style="color: #000099; font-weight: bold;">\&quot;</span>color:#f00;<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;strong&gt;Error:&lt;/strong&gt;&lt;g:message code=&quot;</span>user.<span style="color: #660066;">kerberos</span>.23<span style="color: #3366CC;">&quot; /&gt;&lt;/p&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>hasError<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'user.kerberos.24'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#box&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;p class=<span style="color: #000099; font-weight: bold;">\&quot;</span>class<span style="color: #000099; font-weight: bold;">\&quot;</span> style=<span style="color: #000099; font-weight: bold;">\&quot;</span>color:#f00;<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;strong&gt;Error:&lt;/strong&gt;&lt;g:message code=&quot;</span>user.<span style="color: #660066;">kerberos</span>.24<span style="color: #3366CC;">&quot; /&gt;&lt;/p&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#box&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;form id=<span style="color: #000099; font-weight: bold;">\&quot;</span>form<span style="color: #000099; font-weight: bold;">\&quot;</span> method=<span style="color: #000099; font-weight: bold;">\&quot;</span>POST<span style="color: #000099; font-weight: bold;">\&quot;</span> action=<span style="color: #000099; font-weight: bold;">\&quot;</span>http://localhost:8080/AppHub/auth/signIn<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;/form&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#form&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;input type=<span style="color: #000099; font-weight: bold;">\&quot;</span>hidden<span style="color: #000099; font-weight: bold;">\&quot;</span> name=<span style="color: #000099; font-weight: bold;">\&quot;</span>targetUrl<span style="color: #000099; font-weight: bold;">\&quot;</span> value=<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #339933;">+</span>targetUrl<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span> /&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#form&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;input type=<span style="color: #000099; font-weight: bold;">\&quot;</span>hidden<span style="color: #000099; font-weight: bold;">\&quot;</span> name=<span style="color: #000099; font-weight: bold;">\&quot;</span>returnUrl<span style="color: #000099; font-weight: bold;">\&quot;</span> value=<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #339933;">+</span>returnUrl<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span> /&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#form&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;input type=<span style="color: #000099; font-weight: bold;">\&quot;</span>hidden<span style="color: #000099; font-weight: bold;">\&quot;</span> name=<span style="color: #000099; font-weight: bold;">\&quot;</span>ip<span style="color: #000099; font-weight: bold;">\&quot;</span> value=<span style="color: #000099; font-weight: bold;">\&quot;</span>${request.getRemoteAddr()}<span style="color: #000099; font-weight: bold;">\&quot;</span> /&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#form&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;ul&gt;&lt;/ul&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#form &gt; ul&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;li&gt;&lt;label for=<span style="color: #000099; font-weight: bold;">\&quot;</span>username<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;Username&lt;/label&gt;&lt;div&gt;&lt;input type=<span style="color: #000099; font-weight: bold;">\&quot;</span>text<span style="color: #000099; font-weight: bold;">\&quot;</span> name=<span style="color: #000099; font-weight: bold;">\&quot;</span>username<span style="color: #000099; font-weight: bold;">\&quot;</span> class=<span style="color: #000099; font-weight: bold;">\&quot;</span>max text<span style="color: #000099; font-weight: bold;">\&quot;</span> /&gt;&lt;/div&gt;&lt;/li&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#form &gt; ul&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;li&gt;&lt;label for=<span style="color: #000099; font-weight: bold;">\&quot;</span>password<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;Password&lt;/label&gt;&lt;div&gt;&lt;input type=<span style="color: #000099; font-weight: bold;">\&quot;</span>password<span style="color: #000099; font-weight: bold;">\&quot;</span> name=<span style="color: #000099; font-weight: bold;">\&quot;</span>password<span style="color: #000099; font-weight: bold;">\&quot;</span> class=<span style="color: #000099; font-weight: bold;">\&quot;</span>max text<span style="color: #000099; font-weight: bold;">\&quot;</span> /&gt;&lt;/div&gt;&lt;/li&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#form &gt; ul&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;li&gt;&lt;input type=<span style="color: #000099; font-weight: bold;">\&quot;</span>submit<span style="color: #000099; font-weight: bold;">\&quot;</span> name=<span style="color: #000099; font-weight: bold;">\&quot;</span>submit<span style="color: #000099; font-weight: bold;">\&quot;</span> class=<span style="color: #000099; font-weight: bold;">\&quot;</span>button<span style="color: #000099; font-weight: bold;">\&quot;</span> value=<span style="color: #000099; font-weight: bold;">\&quot;</span>Sign In<span style="color: #000099; font-weight: bold;">\&quot;</span> /&gt;&lt;/li&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#form &gt; ul&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;li&gt;&lt;a style=<span style="color: #000099; font-weight: bold;">\&quot;</span>color:#0088CC;<span style="color: #000099; font-weight: bold;">\&quot;</span> href=<span style="color: #000099; font-weight: bold;">\&quot;</span>#<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;Forgot Password&lt;/a&gt;&lt;span style=<span style="color: #000099; font-weight: bold;">\&quot;</span>color:#0088CC;<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt; | &lt;/span&gt;&lt;a style=<span style="color: #000099; font-weight: bold;">\&quot;</span>color:#0088CC;<span style="color: #000099; font-weight: bold;">\&quot;</span> href=<span style="color: #000099; font-weight: bold;">\&quot;</span>#<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;Register&lt;/a&gt;&lt;span style=<span style="color: #000099; font-weight: bold;">\&quot;</span>color:#0088CC;<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt; | &lt;/span&gt;&lt;a style=<span style="color: #000099; font-weight: bold;">\&quot;</span>color:#0088CC;<span style="color: #000099; font-weight: bold;">\&quot;</span> href=<span style="color: #000099; font-weight: bold;">\&quot;</span>#<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;Unlock Account&lt;/a&gt;&lt;/li&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">//open dialog</span><br />
&nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#modal&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">dialog</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; autoOpen<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; height<span style="color: #339933;">:</span> <span style="color: #CC0000;">450</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; width<span style="color: #339933;">:</span> <span style="color: #CC0000;">500</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; modal<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; resizable<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; position<span style="color: #339933;">:</span> <span style="color: #3366CC;">'center'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; draggable<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; closeOnEscape<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">false</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">//hide the title bar</span><br />
&nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.ui-dialog-titlebar&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;body&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;form id=<span style="color: #000099; font-weight: bold;">\&quot;</span>form<span style="color: #000099; font-weight: bold;">\&quot;</span> method=<span style="color: #000099; font-weight: bold;">\&quot;</span>POST<span style="color: #000099; font-weight: bold;">\&quot;</span> action=<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #339933;">+</span>targetUrl<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;/form&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#form&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;input type=<span style="color: #000099; font-weight: bold;">\&quot;</span>hidden<span style="color: #000099; font-weight: bold;">\&quot;</span> name=<span style="color: #000099; font-weight: bold;">\&quot;</span>id<span style="color: #000099; font-weight: bold;">\&quot;</span> value=<span style="color: #000099; font-weight: bold;">\&quot;</span>${id}<span style="color: #000099; font-weight: bold;">\&quot;</span> /&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#form&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;input type=<span style="color: #000099; font-weight: bold;">\&quot;</span>hidden<span style="color: #000099; font-weight: bold;">\&quot;</span> name=<span style="color: #000099; font-weight: bold;">\&quot;</span>ip<span style="color: #000099; font-weight: bold;">\&quot;</span> value=<span style="color: #000099; font-weight: bold;">\&quot;</span>${request.getRemoteAddr()}<span style="color: #000099; font-weight: bold;">\&quot;</span> /&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#form&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">submit</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #003366; font-weight: bold;">function</span> getParameters<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> vars <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> hash<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> hashes <span style="color: #339933;">=</span> window.<span style="color: #660066;">location</span>.<span style="color: #660066;">href</span>.<span style="color: #660066;">slice</span><span style="color: #009900;">&#40;</span>window.<span style="color: #660066;">location</span>.<span style="color: #660066;">href</span>.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'?'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&amp;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> hashes.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; hash <span style="color: #339933;">=</span> hashes<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'='</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; vars.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span>hash<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; vars<span style="color: #009900;">&#91;</span>hash<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> hash<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> vars<span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #003366; font-weight: bold;">function</span> getParameter<span style="color: #009900;">&#40;</span><span style="color: #000066;">name</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; <span style="color: #000066; font-weight: bold;">return</span> getParameters<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span><span style="color: #000066;">name</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #003366; font-weight: bold;">function</span> getErrors<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>getParameter<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'error'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> getParameter<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'error'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">';'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">null</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #003366; font-weight: bold;">function</span> hasError<span style="color: #009900;">&#40;</span>code<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; <span style="color: #003366; font-weight: bold;">var</span> errors <span style="color: #339933;">=</span> getErrors<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>getErrors<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> getErrors<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>errors<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> code<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>Could it be cleaner? Sure and when I hone in my JQuery skills I will definitely clean it up, but for now it works. =)</p>
]]></content:encoded>
			<wfw:commentRss>http://bottomupdesign.net/?feed=rss2&amp;p=103</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RESTClient 2.0</title>
		<link>http://bottomupdesign.net/?p=100</link>
		<comments>http://bottomupdesign.net/?p=100#comments</comments>
		<pubDate>Tue, 19 Jan 2010 19:52:31 +0000</pubDate>
		<dc:creator>Jonathan Chauncey</dc:creator>
				<category><![CDATA[REST]]></category>
		<category><![CDATA[groovy]]></category>

		<guid isPermaLink="false">http://bottomupdesign.net/?p=100</guid>
		<description><![CDATA[1234567891011121314151617181920212223242526272829303132333435363738394041424344454647import java.net.HttpURLConnection;

class RESTClient &#123;
&#160; &#160; String url
&#160; &#160; String method = &#34;GET&#34;
&#160; &#160; String body //I want the String representation of the object you want to send (either JSON or XML)
&#160; &#160; String data //This is where the response data is stored
&#160; &#160; Node xml //Store the processed response for xml in here
&#160; &#160; Integer [...]]]></description>
			<content:encoded><![CDATA[<div class="codecolorer-container groovy blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br /></div></td><td><div class="groovy codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #a1a100;">java.net.HttpURLConnection</span><span style="color: #66cc66;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">class</span> RESTClient <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #aaaadd; font-weight: bold;">String</span> url<br />
&nbsp; &nbsp; <span style="color: #aaaadd; font-weight: bold;">String</span> method <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">&quot;GET&quot;</span><br />
&nbsp; &nbsp; <span style="color: #aaaadd; font-weight: bold;">String</span> body <span style="color: #808080; font-style: italic;">//I want the String representation of the object you want to send (either JSON or XML)</span><br />
&nbsp; &nbsp; <span style="color: #aaaadd; font-weight: bold;">String</span> data <span style="color: #808080; font-style: italic;">//This is where the response data is stored</span><br />
&nbsp; &nbsp; Node xml <span style="color: #808080; font-style: italic;">//Store the processed response for xml in here</span><br />
&nbsp; &nbsp; <span style="color: #aaaadd; font-weight: bold;">Integer</span> status <span style="color: #808080; font-style: italic;">//Where the status code is held, like 200, 201, 404, 400, etc...</span><br />
&nbsp; &nbsp; <span style="color: #aaaadd; font-weight: bold;">Map</span> headers <span style="color: #66cc66;">=</span> <span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;Content-Type&quot;</span>:<span style="color: #ff0000;">&quot;text/xml&quot;</span>, <span style="color: #ff0000;">&quot;Accept&quot;</span>:<span style="color: #ff0000;">&quot;text/xml&quot;</span><span style="color: #66cc66;">&#93;</span><br />
&nbsp; &nbsp; <span style="color: #aaaadd; font-weight: bold;">Map</span> params<br />
&nbsp; &nbsp; <span style="color: #aaaadd; font-weight: bold;">HttpURLConnection</span> request<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">def</span> makeRemoteCall<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; request <span style="color: #66cc66;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #aaaadd; font-weight: bold;">URL</span><span style="color: #66cc66;">&#40;</span>url<span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">openConnection</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//This is set to GET by default</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; request.<span style="color: #006600;">setRequestMethod</span><span style="color: #66cc66;">&#40;</span>method<span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//Use the each closure to set all the requestHeader values</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; headers.<span style="color: #663399;">each</span> <span style="color: #66cc66;">&#123;</span> name, value <span style="color: #66cc66;">-&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; request.<span style="color: #006600;">setRequestProperty</span><span style="color: #66cc66;">&#40;</span>name, value<span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//Check to see what method you are performing, if post or put then you need to write out to the stream.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>method <span style="color: #b1b100;">in</span> <span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'POST'</span>, <span style="color: #ff0000;">'PUT'</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; request.<span style="color: #006600;">doOutput</span> <span style="color: #66cc66;">=</span> <span style="color: #000000; font-weight: bold;">true</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; request.<span style="color: #006600;">outputStream</span>.<span style="color: #FFCC33;">withWriter</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;ASCII&quot;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> stream <span style="color: #66cc66;">-&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; stream <span style="color: #66cc66;">&lt;&lt;</span> body <span style="color: #808080; font-style: italic;">//Hopefully your body is well formatted xml or json =D</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; request.<span style="color: #006600;">connect</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; status <span style="color: #66cc66;">=</span> request.<span style="color: #006600;">getResponseCode</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>status <span style="color: #66cc66;">==</span> <span style="color: #cc66cc;">200</span> <span style="color: #66cc66;">||</span> status <span style="color: #66cc66;">==</span> <span style="color: #cc66cc;">201</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>method <span style="color: #b1b100;">in</span> <span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'GET'</span>, <span style="color: #ff0000;">'POST'</span>, <span style="color: #ff0000;">'PUT'</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; data <span style="color: #66cc66;">=</span> request.<span style="color: #006600;">content</span>.<span style="color: #006600;">text</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>headers<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;Content-Type&quot;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #b1b100;">in</span> <span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;text/xml&quot;</span>, <span style="color: #ff0000;">&quot;application/xml&quot;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&amp;&amp;</span> data<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xml <span style="color: #66cc66;">=</span> <span style="color: #000000; font-weight: bold;">new</span> XmlParser<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">parseText</span><span style="color: #66cc66;">&#40;</span>data<span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">this</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; <br />
<span style="color: #66cc66;">&#125;</span></div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://bottomupdesign.net/?feed=rss2&amp;p=100</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Restful Client update</title>
		<link>http://bottomupdesign.net/?p=96</link>
		<comments>http://bottomupdesign.net/?p=96#comments</comments>
		<pubDate>Tue, 19 Jan 2010 19:49:15 +0000</pubDate>
		<dc:creator>Jonathan Chauncey</dc:creator>
				<category><![CDATA[groovy]]></category>
		<category><![CDATA[push]]></category>

		<guid isPermaLink="false">http://bottomupdesign.net/?p=96</guid>
		<description><![CDATA[So I have just finished the first class of my rest client:
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091import groovy.xml.StreamingMarkupBuilder 
import java.net.HttpURLConnection;

import apphub.util.RESTClient 

/**
&#160;* Created by IntelliJ IDEA.
&#160;* User: Chauncey-JL
&#160;* Date: Jan 13, 2010
&#160;* Time: 11:59:39 AM
&#160;* To change this template use File &#124; Settings &#124; File Templates.
&#160;*/
class AccessLevel &#123;
&#160; &#160; String appCode
&#160; &#160; String accessTypeCode
&#160; &#160; String accessLevelCode
&#160; &#160; String displayName
&#160; [...]]]></description>
			<content:encoded><![CDATA[<p>So I have just finished the first class of my rest client:</p>
<div class="codecolorer-container groovy blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br />71<br />72<br />73<br />74<br />75<br />76<br />77<br />78<br />79<br />80<br />81<br />82<br />83<br />84<br />85<br />86<br />87<br />88<br />89<br />90<br />91<br /></div></td><td><div class="groovy codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #a1a100;">groovy.xml.StreamingMarkupBuilder</span> <br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #a1a100;">java.net.HttpURLConnection</span><span style="color: #66cc66;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #a1a100;">apphub.util.RESTClient</span> <br />
<br />
<span style="color: #808080; font-style: italic;">/**<br />
&nbsp;* Created by IntelliJ IDEA.<br />
&nbsp;* User: Chauncey-JL<br />
&nbsp;* Date: Jan 13, 2010<br />
&nbsp;* Time: 11:59:39 AM<br />
&nbsp;* To change this template use File | Settings | File Templates.<br />
&nbsp;*/</span><br />
<span style="color: #000000; font-weight: bold;">class</span> AccessLevel <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #aaaadd; font-weight: bold;">String</span> appCode<br />
&nbsp; &nbsp; <span style="color: #aaaadd; font-weight: bold;">String</span> accessTypeCode<br />
&nbsp; &nbsp; <span style="color: #aaaadd; font-weight: bold;">String</span> accessLevelCode<br />
&nbsp; &nbsp; <span style="color: #aaaadd; font-weight: bold;">String</span> displayName<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">def</span> <span style="color: #000000; font-weight: bold;">static</span> list<span style="color: #66cc66;">&#40;</span>appId, accessTypeCode<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">def</span> accessLevels <span style="color: #66cc66;">=</span> <span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">def</span> client <span style="color: #66cc66;">=</span> <span style="color: #000000; font-weight: bold;">new</span> RESTClient<span style="color: #66cc66;">&#40;</span>url:<span style="color: #ff0000;">&quot;http://localhost:8080/AppHub/accessLevel/${appId}/${accessTypeCode}&quot;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">makeRemoteCall</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>client.<span style="color: #006600;">status</span> <span style="color: #66cc66;">==</span> <span style="color: #aaaadd; font-weight: bold;">HttpURLConnection</span>.<span style="color: #006600;">HTTP_OK</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; client.<span style="color: #006600;">xml</span>.<span style="color: #006600;">children</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #663399;">each</span> <span style="color: #66cc66;">&#123;</span> list <span style="color: #66cc66;">-&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">def</span> accessLevel <span style="color: #66cc66;">=</span> <span style="color: #000000; font-weight: bold;">new</span> AccessLevel<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; list.<span style="color: #006600;">children</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #663399;">each</span> <span style="color: #66cc66;">&#123;</span> child <span style="color: #66cc66;">-&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; accessLevel.<span style="color: #006600;">setProperty</span><span style="color: #66cc66;">&#40;</span>child.<span style="color: #006600;">name</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>, child.<span style="color: #006600;">text</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; accessLevels.<span style="color: #006600;">add</span><span style="color: #66cc66;">&#40;</span>accessLevel<span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> accessLevels<br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">def</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #663399;">get</span><span style="color: #66cc66;">&#40;</span>appId, accessTypeCode, accessLevelCode<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">def</span> client <span style="color: #66cc66;">=</span> <span style="color: #000000; font-weight: bold;">new</span> RESTClient<span style="color: #66cc66;">&#40;</span>url:<span style="color: #ff0000;">&quot;http://localhost:8080/AppHub/accessLevel/${appId}/${accessTypeCode}/${accessLevelCode}&quot;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">makeRemoteCall</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>client.<span style="color: #006600;">status</span> <span style="color: #66cc66;">==</span> <span style="color: #aaaadd; font-weight: bold;">HttpURLConnection</span>.<span style="color: #006600;">HTTP_OK</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">def</span> accessLevel <span style="color: #66cc66;">=</span> <span style="color: #000000; font-weight: bold;">new</span> AccessLevel<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; client.<span style="color: #006600;">xml</span>.<span style="color: #006600;">children</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #663399;">each</span> <span style="color: #66cc66;">&#123;</span> child <span style="color: #66cc66;">-&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; accessLevel.<span style="color: #006600;">setProperty</span><span style="color: #66cc66;">&#40;</span>child.<span style="color: #006600;">name</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>, child.<span style="color: #006600;">text</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> accessLevel<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">def</span> save<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">def</span> client <span style="color: #66cc66;">=</span> <span style="color: #000000; font-weight: bold;">new</span> RESTClient<span style="color: #66cc66;">&#40;</span>url:<span style="color: #ff0000;">&quot;http://localhost:8080/AppHub/accessLevel&quot;</span>, method:<span style="color: #ff0000;">&quot;POST&quot;</span>, body:<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">toXML</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">toString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">makeRemoteCall</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>client.<span style="color: #006600;">status</span> <span style="color: #66cc66;">==</span> <span style="color: #aaaadd; font-weight: bold;">HttpURLConnection</span>.<span style="color: #006600;">HTTP_CREATED</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">true</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">false</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">def</span> update<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">def</span> client <span style="color: #66cc66;">=</span> <span style="color: #000000; font-weight: bold;">new</span> RESTClient<span style="color: #66cc66;">&#40;</span>url:<span style="color: #ff0000;">&quot;http://localhost:8080/AppHub/accessLevel/${this.appCode}/${this.accessTypeCode}/${this.accessLevelCode}&quot;</span>, method:<span style="color: #ff0000;">&quot;PUT&quot;</span>, body:<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">toXML</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">toString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">makeRemoteCall</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>client.<span style="color: #006600;">status</span> <span style="color: #66cc66;">==</span> <span style="color: #aaaadd; font-weight: bold;">HttpURLConnection</span>.<span style="color: #006600;">HTTP_OK</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">true</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">false</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">def</span> delete<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">def</span> client <span style="color: #66cc66;">=</span> <span style="color: #000000; font-weight: bold;">new</span> RESTClient<span style="color: #66cc66;">&#40;</span>url:<span style="color: #ff0000;">&quot;http://localhost:8080/AppHub/accessLevel/${this.appCode}/${this.accessTypeCode}/${this.accessLevelCode}&quot;</span>, method:<span style="color: #ff0000;">&quot;DELETE&quot;</span>, body:<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">toXML</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">toString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">makeRemoteCall</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>client.<span style="color: #006600;">status</span> <span style="color: #66cc66;">==</span> <span style="color: #aaaadd; font-weight: bold;">HttpURLConnection</span>.<span style="color: #006600;">HTTP_OK</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">true</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">false</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> toXML<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; StreamingMarkupBuilder builder <span style="color: #66cc66;">=</span> <span style="color: #000000; font-weight: bold;">new</span> StreamingMarkupBuilder<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">def</span> accessLevel <span style="color: #66cc66;">=</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mkp.<span style="color: #006600;">xmlDeclaration</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; accessLevel <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; appCode<span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">appCode</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; accessTypeCode<span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">accessTypeCode</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; accessLevelCode<span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">accessLevelCode</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; displayName<span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">displayName</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; builder.<span style="color: #006600;">bind</span><span style="color: #66cc66;">&#40;</span>accessLevel<span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">def</span> <span style="color: #aaaadd; font-weight: bold;">String</span> toString<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">toXML</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; <br />
<span style="color: #66cc66;">&#125;</span></div></td></tr></tbody></table></div>
<p>And the test class:</p>
<div class="codecolorer-container groovy blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br /></div></td><td><div class="groovy codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #a1a100;">apphub.client</span><br />
<br />
<span style="color: #808080; font-style: italic;">//def accessLevel = new AccessLevel(appCode:'LEGALDOC', accessTypeCode:'ACCESS_LVL', accessLevelCode:'TEST', displayName:'TEST')</span><br />
<span style="color: #808080; font-style: italic;">//accessLevel.save()</span><br />
<br />
AccessLevel.<span style="color: #006600;">list</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'LEGALDOC'</span>, <span style="color: #ff0000;">'ACCESS_LVL'</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #663399;">each</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #993399;">println</span> <span style="color: #ff0000;">&quot;APPCODE:${it.appCode}&quot;</span><br />
<span style="color: #66cc66;">&#125;</span><br />
<br />
<span style="color: #993399;">println</span> <span style="color: #ff0000;">&quot;AccessLevel.get().displayName:&quot;</span><span style="color: #66cc66;">+</span>AccessLevel.<span style="color: #663399;">get</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'LEGALDOC'</span>, <span style="color: #ff0000;">'ACCESS_LVL'</span>, <span style="color: #ff0000;">'USER'</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">displayName</span><br />
<br />
<span style="color: #000000; font-weight: bold;">def</span> lvl <span style="color: #66cc66;">=</span> <span style="color: #000000; font-weight: bold;">new</span> AccessLevel<span style="color: #66cc66;">&#40;</span>appCode:<span style="color: #ff0000;">'LEGALDOC'</span>, accessTypeCode:<span style="color: #ff0000;">'ACCESS_LVL'</span>, accessLevelCode:<span style="color: #ff0000;">'TEST'</span>, displayName:<span style="color: #ff0000;">'TEST'</span><span style="color: #66cc66;">&#41;</span><br />
<span style="color: #993399;">println</span> <span style="color: #ff0000;">&quot;AccessLevel.save():${lvl.save()}&quot;</span><br />
<br />
lvl.<span style="color: #006600;">displayName</span> <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'Updated Display Name'</span><br />
<span style="color: #993399;">println</span> <span style="color: #ff0000;">&quot;AccessLevel.update():${lvl.update()} --- Display Name:${lvl.displayName}&quot;</span></div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://bottomupdesign.net/?feed=rss2&amp;p=96</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My own version of the RESTClient&#8230; Without all of the jars!</title>
		<link>http://bottomupdesign.net/?p=94</link>
		<comments>http://bottomupdesign.net/?p=94#comments</comments>
		<pubDate>Fri, 15 Jan 2010 20:27:43 +0000</pubDate>
		<dc:creator>Jonathan Chauncey</dc:creator>
				<category><![CDATA[REST]]></category>
		<category><![CDATA[groovy]]></category>

		<guid isPermaLink="false">http://bottomupdesign.net/?p=94</guid>
		<description><![CDATA[Ok here is the rough version I came up with this afternoon. It will definitely get better as I move deeper into my API.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546package apphub.util;

import java.net.HttpURLConnection;

class RESTClient &#123;
&#160; &#160; String url
&#160; &#160; String method = &#34;GET&#34;
&#160; &#160; String body //I want the String representation of the object you want to send (either JSON or XML)
&#160; [...]]]></description>
			<content:encoded><![CDATA[<p>Ok here is the rough version I came up with this afternoon. It will definitely get better as I move deeper into my API.</p>
<div class="codecolorer-container groovy blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br /></div></td><td><div class="groovy codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #a1a100;">apphub.util</span><span style="color: #66cc66;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #a1a100;">java.net.HttpURLConnection</span><span style="color: #66cc66;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">class</span> RESTClient <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #aaaadd; font-weight: bold;">String</span> url<br />
&nbsp; &nbsp; <span style="color: #aaaadd; font-weight: bold;">String</span> method <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">&quot;GET&quot;</span><br />
&nbsp; &nbsp; <span style="color: #aaaadd; font-weight: bold;">String</span> body <span style="color: #808080; font-style: italic;">//I want the String representation of the object you want to send (either JSON or XML)</span><br />
&nbsp; &nbsp; <span style="color: #aaaadd; font-weight: bold;">String</span> data <span style="color: #808080; font-style: italic;">//This is where the response data is stored</span><br />
&nbsp; &nbsp; Node xml <span style="color: #808080; font-style: italic;">//Store the processed response for xml in here</span><br />
&nbsp; &nbsp; <span style="color: #aaaadd; font-weight: bold;">Integer</span> status <span style="color: #808080; font-style: italic;">//Where the status code is held, like 200, 201, 404, 400, etc...</span><br />
&nbsp; &nbsp; <span style="color: #aaaadd; font-weight: bold;">Map</span> headers <span style="color: #66cc66;">=</span> <span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;Content-Type&quot;</span>:<span style="color: #ff0000;">&quot;application/xml&quot;</span>, <span style="color: #ff0000;">&quot;Accept&quot;</span>:<span style="color: #ff0000;">&quot;text/xml&quot;</span><span style="color: #66cc66;">&#93;</span><br />
&nbsp; &nbsp; <span style="color: #aaaadd; font-weight: bold;">Map</span> params<br />
&nbsp; &nbsp; <span style="color: #aaaadd; font-weight: bold;">HttpURLConnection</span> request<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">def</span> makeRemoteCall<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; request <span style="color: #66cc66;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #aaaadd; font-weight: bold;">URL</span><span style="color: #66cc66;">&#40;</span>url<span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">openConnection</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//This is set to GET by default</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; request.<span style="color: #006600;">setRequestMethod</span><span style="color: #66cc66;">&#40;</span>method<span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//Use the each closure to set all the requestHeader values</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; headers.<span style="color: #663399;">each</span> <span style="color: #66cc66;">&#123;</span> name, value <span style="color: #66cc66;">-&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; request.<span style="color: #006600;">setRequestProperty</span><span style="color: #66cc66;">&#40;</span>name, value<span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//Check to see what method you are performing, if post or put then you need to write out to the stream.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>method <span style="color: #b1b100;">in</span> <span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'POST'</span>, <span style="color: #ff0000;">'PUT'</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; request.<span style="color: #006600;">doOutput</span> <span style="color: #66cc66;">=</span> <span style="color: #000000; font-weight: bold;">true</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; request.<span style="color: #006600;">outputStream</span>.<span style="color: #FFCC33;">withWriter</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;ASCII&quot;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> stream <span style="color: #66cc66;">-&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; stream <span style="color: #66cc66;">&lt;&lt;</span> body <span style="color: #808080; font-style: italic;">//Hopefully your body is well formatted xml or json =D</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; request.<span style="color: #006600;">connect</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; data <span style="color: #66cc66;">=</span> request.<span style="color: #006600;">content</span>.<span style="color: #006600;">text</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>headers<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;Content-Type&quot;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #b1b100;">in</span> <span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;text/xml&quot;</span>, <span style="color: #ff0000;">&quot;application/xml&quot;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&amp;&amp;</span> data<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xml <span style="color: #66cc66;">=</span> <span style="color: #000000; font-weight: bold;">new</span> XmlParser<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">parseText</span><span style="color: #66cc66;">&#40;</span>data<span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; status <span style="color: #66cc66;">=</span> request.<span style="color: #006600;">getResponseCode</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">this</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; <br />
<span style="color: #66cc66;">&#125;</span></div></td></tr></tbody></table></div>
<p>And here is how I am using it.</p>
<div class="codecolorer-container groovy blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br /></div></td><td><div class="groovy codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">def</span> <span style="color: #000000; font-weight: bold;">static</span> list<span style="color: #66cc66;">&#40;</span>appId, accessTypeCode<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">def</span> accessLevels <span style="color: #66cc66;">=</span> <span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">def</span> client <span style="color: #66cc66;">=</span> <span style="color: #000000; font-weight: bold;">new</span> RESTClient<span style="color: #66cc66;">&#40;</span>url:<span style="color: #ff0000;">&quot;http://localhost:8080/AppHub/accessLevel/${appId}/${accessTypeCode}&quot;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">makeRemoteCall</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>client.<span style="color: #006600;">status</span> <span style="color: #66cc66;">==</span> <span style="color: #aaaadd; font-weight: bold;">HttpURLConnection</span>.<span style="color: #006600;">HTTP_OK</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; client.<span style="color: #006600;">xml</span>.<span style="color: #006600;">children</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #663399;">each</span> <span style="color: #66cc66;">&#123;</span> list <span style="color: #66cc66;">-&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">def</span> accessLevel <span style="color: #66cc66;">=</span> <span style="color: #000000; font-weight: bold;">new</span> AccessLevel<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; list.<span style="color: #006600;">children</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #663399;">each</span> <span style="color: #66cc66;">&#123;</span> child <span style="color: #66cc66;">-&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; accessLevel.<span style="color: #006600;">setProperty</span><span style="color: #66cc66;">&#40;</span>child.<span style="color: #006600;">name</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>, child.<span style="color: #006600;">text</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; accessLevels.<span style="color: #006600;">add</span><span style="color: #66cc66;">&#40;</span>accessLevel<span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> accessLevels<br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">def</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #663399;">get</span><span style="color: #66cc66;">&#40;</span>appId, accessTypeCode, accessLevelCode<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">def</span> client <span style="color: #66cc66;">=</span> <span style="color: #000000; font-weight: bold;">new</span> RESTClient<span style="color: #66cc66;">&#40;</span>url:<span style="color: #ff0000;">&quot;http://localhost:8080/AppHub/accessLevel/${appId}/${accessTypeCode}/${accessLevelCode}&quot;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">makeRemoteCall</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>client.<span style="color: #006600;">status</span> <span style="color: #66cc66;">==</span> <span style="color: #aaaadd; font-weight: bold;">HttpURLConnection</span>.<span style="color: #006600;">HTTP_OK</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">def</span> accessLevel <span style="color: #66cc66;">=</span> <span style="color: #000000; font-weight: bold;">new</span> AccessLevel<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; client.<span style="color: #006600;">xml</span>.<span style="color: #006600;">children</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #663399;">each</span> <span style="color: #66cc66;">&#123;</span> child <span style="color: #66cc66;">-&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; accessLevel.<span style="color: #006600;">setProperty</span><span style="color: #66cc66;">&#40;</span>child.<span style="color: #006600;">name</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>, child.<span style="color: #006600;">text</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> accessLevel<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div></td></tr></tbody></table></div>
<p>Pretty simple =D</p>
]]></content:encoded>
			<wfw:commentRss>http://bottomupdesign.net/?feed=rss2&amp;p=94</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
