<?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>Silveira Neto &#187; GlassFish</title>
	<atom:link href="http://silveiraneto.net/tag/glassfish/feed/" rel="self" type="application/rss+xml" />
	<link>http://silveiraneto.net</link>
	<description>the world is a pixel</description>
	<lastBuildDate>Sun, 08 Jan 2012 05:17:57 +0000</lastBuildDate>
	<language>pt-br</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
		<item>
		<title>Webinar de Glassfish com o Arun Gupta</title>
		<link>http://silveiraneto.net/2009/01/29/webinar-de-glassfish-com-o-arun-gupta/</link>
		<comments>http://silveiraneto.net/2009/01/29/webinar-de-glassfish-com-o-arun-gupta/#comments</comments>
		<pubDate>Thu, 29 Jan 2009 10:18:42 +0000</pubDate>
		<dc:creator>Silveira</dc:creator>
				<category><![CDATA[português]]></category>
		<category><![CDATA[Arun Gupta]]></category>
		<category><![CDATA[Elluminate]]></category>
		<category><![CDATA[GlassFish]]></category>
		<category><![CDATA[OSUM]]></category>
		<category><![CDATA[Sun]]></category>
		<category><![CDATA[webinar]]></category>

		<guid isPermaLink="false">http://silveiraneto.net/?p=2221</guid>
		<description><![CDATA[Glass fish da Wikipédia. conduzirá um webinar sobre o Servidor de Aplicações Glassfish. Muitos de vocês devem conhecer o Arun Gupta, Entusiasta de Glassfish com enfase em consolidação web na Sun. Ele foi um dos condutores da especificação da plataforma Java, está comprometidos com diversos projetos de Código Aberto e Software Livre, participou de vários [...]]]></description>
			<content:encoded><![CDATA[<p align="center"><img class="alignnone size-full wp-image-2220" title="painted indian glassy fish from Wikipedia" src="http://silveiraneto.net/wp-content/uploads/2009/01/painted_indian_glassy_fish.jpg" alt="painted indian glassy fish from Wikipedia" width="450" height="245" /><br />
<a href="http://en.wikipedia.org/wiki/Indian_glassy_fish">Glass fish</a> da Wikipédia.</p>
<p>conduzirá um webinar sobre o <a title="Projeto Glassfish" href="https://glassfish.dev.java.net/">Servidor de Aplicações Glassfish</a>.</p>
<p>Muitos de vocês devem conhecer o <a title="Blog do Arun" href="http://blogs.sun.com/arungupta">Arun Gupta</a>, Entusiasta de Glassfish com enfase em consolidação web na Sun. Ele foi um dos condutores da especificação da plataforma Java, está comprometidos com diversos projetos de Código Aberto e Software Livre, participou de vários comites de padronização e participou de releases ddo Java EE e SE. É um blogueiro prolífico com várias dicas muito úteis no seu <a href="http://blogs.sun.com/arungupta">http://blogs.sun.com/arungupta</a>.</p>
<p style="text-align: center;"><img class="aligncenter" title="Arun Gupta no JavaOne" src="http://farm1.static.flickr.com/47/148875359_923a7aa83d.jpg" alt="" width="500" height="375" /><br />
<small>Arun Gupta no JavaOne. Foto do <a href="http://flickr.com/photos/hadleynet/148875359/">Marc Hadley</a>.</small></p>
<p>Este webinar será conduzido em <strong>Inglês</strong> e está marcado para o <strong>dia 3 de Fevereiro de 2009</strong>, as 10:30 am aqui no horário de Fortaleza, e <del datetime="2009-02-02T13:57:42+00:00">9:30 am</del> 11:30 em São Paulo e 8:30 am no horário da Califórnia.</p>
<p>Para participar responda o RSVP e pegue o link do Elluminate dentro do <a href="http://osum.sun.com/events/event/show?id=2181626%3AEvent%3A412890&amp;rsvpConfirm=1"><strong>site do evento no OSUM</strong></a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://silveiraneto.net/2009/01/29/webinar-de-glassfish-com-o-arun-gupta/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>2nd Prize at Sun Student Reviews Contest</title>
		<link>http://silveiraneto.net/2008/12/30/2nd-prize-at-sun-student-reviews-contest/</link>
		<comments>http://silveiraneto.net/2008/12/30/2nd-prize-at-sun-student-reviews-contest/#comments</comments>
		<pubDate>Tue, 30 Dec 2008 10:14:03 +0000</pubDate>
		<dc:creator>Silveira</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[2nd]]></category>
		<category><![CDATA[GlassFish]]></category>
		<category><![CDATA[Jonathan Schwartz]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[Student Reviews Contest]]></category>
		<category><![CDATA[Sun Microsystems]]></category>

		<guid isPermaLink="false">http://silveiraneto.net/?p=2038</guid>
		<description><![CDATA[Project Xort won a second place prize at the MySQL and GlassFish Student Reviews Contest. A lot of guys here from Brazil were prized, congractulations guys! Very cool projects, worth to take a look. I won a certificate (seems to be really autographed by Jonathan Schwartz *_* I want to believe) that I will frame [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Project Xort" href="../2008/10/21/short-urls-with-glassfishmysql/">Project Xort</a> won a second place prize at the <a title="MYSQL+Glassfish Contest" href="http://blogs.sun.com/students/entry/mysql_and_glassfish_student_reviews">MySQL and GlassFish Student Reviews Contest</a>. A lot of guys here from Brazil were prized, congractulations guys! Very cool projects, worth to <a title="contest winners" href="http://blogs.sun.com/students/entry/mysql_and_glassfish_student_reviews">take a look</a>.</p>
<p style="text-align: center;"><img src="http://farm4.static.flickr.com/3211/3150311116_f7ecc4194e.jpg" alt="Prize" /></p>
<p>I won a certificate (seems to be really autographed by <a title="Jonathan Schwartz's Blog" href="http://blogs.sun.com/jonathan/">Jonathan Schwartz</a> *_* I want to believe) that I will frame and put in my room and a $250 dollars check that I&#8217;ll save for a trip next year. \o/</p>
<p style="text-align: center;"><img class="aligncenter" src="http://farm4.static.flickr.com/3125/3149482603_4653c878c4.jpg" alt="Prize" /></p>
<p>There&#8217;s always cool contests running. Let&#8217;s keep our eyes open. ;)</p>
]]></content:encoded>
			<wfw:commentRss>http://silveiraneto.net/2008/12/30/2nd-prize-at-sun-student-reviews-contest/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Buzz on JavaFX and Inkscape</title>
		<link>http://silveiraneto.net/2008/11/26/buzz-on-javafx-and-inkscape/</link>
		<comments>http://silveiraneto.net/2008/11/26/buzz-on-javafx-and-inkscape/#comments</comments>
		<pubDate>Wed, 26 Nov 2008 21:28:27 +0000</pubDate>
		<dc:creator>Silveira</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[GlassFish]]></category>
		<category><![CDATA[Inkscape]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JavaFX]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[Sun]]></category>
		<category><![CDATA[xort]]></category>

		<guid isPermaLink="false">http://silveiraneto.net/?p=1808</guid>
		<description><![CDATA[At November, 26, on the main page of java.sun.com at the section From The Blogosfere Thanks for all comments, suggestions and feedback on the post Inkscape and JavaFX working together. The JavaFX guru James Weaver posted about on his blog and it also figured out on java.sun.com on the From The Blogosfere section. Bob said [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="size-full wp-image-1809 aligncenter" title="java.sun.com" src="http://silveiraneto.net/wp-content/uploads/2008/11/javasuncom.png" alt="" width="400" height="269" /><br />
<small>At November, 26, on the main page of <a href="http://sun.java.com">java.sun.com</a> at the section <em>From The Blogosfere</em></small></p>
<p>Thanks for all comments, suggestions and feedback on the post <a title="Blog post" href="http://silveiraneto.net/2008/11/21/inkscape-and-javafx-working-together/">Inkscape and JavaFX working together</a>. The JavaFX guru James Weaver <a title="Weaver's blog" href="http://learnjavafx.typepad.com/weblog/2008/11/up-the-nile-with-a-paddle.html">posted about</a> on his blog and it also figured out on <a title="Java at Sun" href="http://java.sun.com">java.sun.com</a> on the <em>From The Blogosfere</em> section.</p>
<p>Bob <a title="Comment" href="http://silveiraneto.net/2008/11/21/inkscape-and-javafx-working-together/#comment-3071">said that</a> there are <a title="Build Binaries" href="http://inkscape.modevia.com/win32/?C=M;O=D">build binaries</a> of Inkscape for Windows, so we can already see it 0.46-devel working without compiling yourself yours.</p>
<p>\o/</p>
<p>And hey, <a title="Project Xort" href="http://silveiraneto.net/2008/10/21/short-urls-with-glassfishmysql/">Project Xort</a> won a second place prize at the <a title="MYSQL+Glassfish Contest" href="http://blogs.sun.com/students/entry/mysql_and_glassfish_student_reviews">MySQL and GlassFish Student Reviews Contest</a>. A lot of guys here from Brazil were prized, congractulations guys!</p>
]]></content:encoded>
			<wfw:commentRss>http://silveiraneto.net/2008/11/26/buzz-on-javafx-and-inkscape/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Short urls with Glassfish+MySQL</title>
		<link>http://silveiraneto.net/2008/10/21/short-urls-with-glassfishmysql/</link>
		<comments>http://silveiraneto.net/2008/10/21/short-urls-with-glassfishmysql/#comments</comments>
		<pubDate>Wed, 22 Oct 2008 02:27:18 +0000</pubDate>
		<dc:creator>Silveira</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[GlassFish]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[servlet]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[URI]]></category>
		<category><![CDATA[url]]></category>
		<category><![CDATA[Web Application]]></category>
		<category><![CDATA[xort]]></category>

		<guid isPermaLink="false">http://silveiraneto.net/?p=1503</guid>
		<description><![CDATA[Pipes, Creative Commons photo by flattop341. 1. The Problem Internet is full of long urls and meaningless. Long urls are difficult to remember or print, usually full of redundancy and low semantic. With short and meaningful urls you can avoid thes problems and even achieve profitable goals with SEO SEO (search engine optimization) technics. There [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="size-full wp-image-1517 aligncenter" title="pipes_by_flattop341_on_flickr" src="http://silveiraneto.net/wp-content/uploads/2008/10/pipes_by_flattop341_on_flickr.jpg" alt="" width="500" height="375" /><br />
Pipes, Creative Commons photo by <a href="http://flickr.com/photos/flattop341/253765659/">flattop341</a>.</p>
<h2>1. The Problem</h2>
<p>Internet is full of long urls and meaningless.</p>
<p>Long urls are difficult to remember or print, usually full of redundancy and low semantic. With short and meaningful urls you can avoid thes problems and even achieve profitable goals with SEO<br />
SEO (search engine optimization) technics.</p>
<p>There are services like <a title="Tiny URL" href="http://tinyurl.com/">Tiny URL</a>, <a title="Fancy URL" href="http://www.fancyurl.com/home.php">Fancy URL</a>, <a title="Moo URL" href="http://moourl.com/">Moo URL</a> and others. Although they solve part of the problems, they bring <a title="Wikipedia, english" href="http://en.wikipedia.org/wiki/TinyURL#Criticism">several others</a>. Another problem is if you have a web site like example.com and use a third-party service for short urls you are losing part of your mind-share with your users and clients.</p>
<p>As an example, if a example.com company wants to promote a open work position would be preferable spread a example.com/jobs instead of a tinyurl.com/examplejobs, or even worst, a tinyurl.com/3i4i592 (meaningless hash).</p>
<h2>2. Solution Approach</h2>
<p>I created a little program called <a title="xort project page" href="http://xort.dev.java.net">xort</a> that can be placed on your own server and provide you own short maintening your base url.</p>
<p style="text-align: center;"><img title="pipe_abstraction" src="http://silveiraneto.net/wp-content/uploads/2008/10/pipe_abstraction.png" alt="" /></p>
<p>I use a pipe abstraction. Each pipe redirects from a key url to an output url.</p>
<p>The idea is that you have <a title="xort project page" href="http://xort.dev.java.net">xort</a> installed and associated into your domain (preferably on /x). A pipe inside example.com would be like example.com/x/jobs.</p>
<h2>3. Tools</h2>
<p>All those tools are multi platform, open source and free.</p>
<h3>3.1 Glassfish Application Server</h3>
<p style="text-align: center;"><img title="Glassfish logo" src="../wp-content/uploads/2008/09/glassfish_logo_large.gif" alt="" /></p>
<p><a title="Glassfish Project" href="http://glassfish.dev.java.net">Glassfish</a> is an open source application server project led by Sun Microsystems for the Java Enterprise Edition (Java EE) platform. It&#8217;s very easy to install and run and have a very nice administration web interface where you can do from simple tasks like deploy a application to more complexes like clustering.</p>
<p style="text-align: center;"><img class="size-full wp-image-1249" title="glassfish_web_apps" src="../wp-content/uploads/2008/09/glassfish_web_apps.png" alt="" /><br />
Glassfish Admin Console</p>
<p>To develop the application I&#8217;m using <a title="NetBeans 6.5 Beta Download" href="http://download.netbeans.org/netbeans/6.5/beta/">NetBeans 6.5 Beta</a> that comes with <em>Glassfish V3 prelude b15b</em>. Netbeans also provides a integration of project, database and web server.</p>
<p style="text-align: center;"><img class="size-full wp-image-1504 aligncenter" title="netbeans services server glassfish" src="http://silveiraneto.net/wp-content/uploads/2008/10/netbeans_services_server_glassfish.png" alt="" width="361" height="161" /></p>
<p>Nevertheless, Glassfish has no dependencies with any IDE and perfectly works by alone. If you need <a title="Glassfish on Linux" href="http://silveiraneto.net/2008/09/07/glassfish-on-linux/">I wrote this post</a> explaining how to install and deploy a application on Glassfish from scratch.</p>
<h3>3.2 MySQL Relational Database</h3>
<p style="text-align: center;"><img class="size-full wp-image-1505 aligncenter" title="mysql" src="http://silveiraneto.net/wp-content/uploads/2008/10/mysql.png" alt="" width="180" height="93" /></p>
<p>MySQL is a relational database management system and probably the most used database on internet (has more than 11 million installations). It&#8217;s also very easy to install and administer, through command line or many gui interfaces.</p>
<p>To install MySQL and JDBC driver on Ubuntu just run as root:</p>
<blockquote><p># apt-get install mysql-server libmysql-java</p></blockquote>
<p>After installing and configuring it you can <a title="Looking for databases drivers" href="http://silveiraneto.net/2008/10/13/looking-for-databases-drivers/">test the jdbc driver throught this servlet code</a>. You can optionally register the MySQL on NetBeans to have a easier access to it thought the service tab.</p>
<p style="text-align: center;"><img class="size-full aligncenter" title="netbeans_services_databases" src="http://silveiraneto.net/wp-content/uploads/2008/10/netbeans_services_databases.png" alt="" /></p>
<p>At the command line you can invoke <em>mysql</em> command line interface and use MySql commands or SQL queries. I&#8217;ll login and create a database called xort:</p>
<blockquote><p>$ <strong>mysql -u username -p</strong><br />
Enter password:<br />
Welcome to the MySQL monitor.  Commands end with ; or \g.<br />
Your MySQL connection id is 13<br />
Server version: 5.0.51a-3ubuntu5.3 (Ubuntu)</p>
<p>Type &#8216;help;&#8217; or &#8216;\h&#8217; for help. Type &#8216;\c&#8217; to clear the buffer.</p>
<p>mysql&gt; <strong>create database xort;</strong><br />
Query OK, 1 row affected (0.06 sec)</p></blockquote>
<p>You could also create this database by an SQL statement:</p>
<div class="wp_syntax">
<div class="code">
<pre class="sql sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">DATABASE</span> xort;</pre>
</div>
</div>
<p>To select the database xort:</p>
<blockquote><p>mysql&gt; <strong>use xort;</strong><br />
Reading table information for completion of table and column names<br />
You can turn off this feature to get a quicker startup with -A</p>
<p>Database changed<br />
mysql&gt;</p></blockquote>
<p>Now we create a database called pipes with fields pin (pipe in) and pout (pipe out). They represent the input url and the output url of our pipe abstraction.</p>
<div class="wp_syntax">
<div class="code">
<pre class="sql sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">TABLE</span> pipes <span style="color: #66cc66;">&#40;</span>
   pin varchar<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
   pout varchar<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#41;</span>;</pre>
</div>
</div>
<p>As we expect a lot of searches queries on this table, we can optionally create a index for it on pin field. This can reduce ours searches from O(n) to O(logn) (because pin&#8217;s will be ordered so don&#8217;t need to look all pipes, we can use logn algorithms like binary search).</p>
<div class="wp_syntax">
<div class="code">
<pre class="sql sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">INDEX</span> pinindex <span style="color: #993333; font-weight: bold;">ON</span> pipes <span style="color: #66cc66;">&#40;</span>pin<span style="color: #66cc66;">&#41;</span>;</pre>
</div>
</div>
<p>Another trick to improve our speed is recycling connections through connection pools.</p>
<p style="text-align: center;"><img class="size-full wp-image-1535 aligncenter" title="glassfish pool" src="http://silveiraneto.net/wp-content/uploads/2008/10/glassfish_pool.png" alt="" width="300" height="197" /></p>
<p>Creating a pool of MySQL connections on Glassfish is very easy. There&#8217;re two good tutorials on this subject:</p>
<ul>
<li> <a title="Permanent Link: Glassfish v2 UR1 and MySQL Connection Pool" rel="bookmark" href="http://thestewscope.wordpress.com/2008/01/08/glassfish-v2-ur1-and-mysql-connection-pool/">Glassfish v2 UR1 and MySQL Connection Pool</a></li>
<li><a title="Pooling with MySQL" href="http://dev.mysql.com/tech-resources/articles/connection_pooling_with_connectorj.html">Connection pooling with MySQL Connector/J</a></li>
</ul>
<p>And now we populate the database with some initial pipes.</p>
<div class="wp_syntax">
<div class="code">
<pre class="sql sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> pipes <span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'blog'</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'http://silveiraneto.net'</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> pipes <span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'cejug'</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'http://cejug.org/display/cejug/Home'</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> pipes <span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'orkut'</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'http://www.orkut.com.br/Main#Profile.aspx?rl=ls&amp;amp;uid=12443310329436634134'</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> pipes <span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'glassfish'</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'http://glassfish.dev.java.net'</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> pipes <span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'mysql'</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'http://dev.mysql.org'</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> pipes <span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'twitter'</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'http://twitter.com/silveira'</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> pipes <span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'lab'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'http://maps.google.com/maps?f=q&amp;amp;geocode=&amp;amp;q=campus+do+pici&amp;amp;g=Fortaleza,+Brazil&amp;amp;ie=UTF8&amp;amp;t=h&amp;amp;ll=-3.745978,-38.574023&amp;amp;spn=0.002452,0.004823&amp;amp;z=18'</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> pipes <span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'videos'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'http://br.youtube.com/user/NetoSilveira'</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> pipes <span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'photos'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'http://flickr.com/photos/silveiraneto/'</span><span style="color: #66cc66;">&#41;</span>;</pre>
</div>
</div>
<h2>4. Program</h2>
<p>Basically we have just a program that implement this simple behavior:</p>
<ol>
<li>separate the key from the url.</li>
<li>if the key is a pin from a pipe then redirect to that pout.</li>
<li>else provide a way to create a new pipe.</li>
<li>list all pipes.</li>
<li>provide a way to remove a pipe.</li>
</ol>
<p>To get the key we need to separate the proper part of the request uri:</p>
<div class="wp_syntax">
<div class="code">
<pre class="java java" style="font-family:monospace;"><span style="color: #003399;">String</span> uri <span style="color: #339933;">=</span> request.<span style="color: #006633;">getRequestURI</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #003399;">String</span> key <span style="color: #339933;">=</span> uri.<span style="color: #006633;">substring</span><span style="color: #009900;">&#40;</span>request.<span style="color: #006633;">getContextPath</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">length</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">+</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span>;</pre>
</div>
</div>
<p>After that we check if it matches with a pin of some pipe. In this case we redirect user for the correspondent pout:</p>
<div class="wp_syntax">
<div class="code">
<pre class="java java" style="font-family:monospace;">response.<span style="color: #006633;">sendRedirect</span><span style="color: #009900;">&#40;</span>pout<span style="color: #009900;">&#41;</span>;</pre>
</div>
</div>
<p>Notice that using this approach we can connect a url to a extern or intern url (even to another pipe).</p>
<h2>5. Download</h2>
<p>Check out the xort project and sources at <a href="http://xort.dev.java.net/">xort.dev.java.net</a>:</p>
<ul>
<li><a href="https://xort.dev.java.net/servlets/ProjectDocumentList">Releases</a>.</li>
<li><a title="Subversion" href="https://xort.dev.java.net/source/browse/xort/trunk/">Browse Source Code</a>.</li>
</ul>
<p>Or grab sources and the current build with:</p>
<blockquote><p>svn checkout https://xort.dev.java.net/svn/xort/trunk xort</p></blockquote>
<p>Parameters can be passed by the the web.xml file:</p>
<div class="wp_syntax">
<div class="code">
<pre class="xml xml" style="font-family:monospace;">   Set if users can add new pipes using the web interface.
allowNewPipes
true
&nbsp;
   JDBC driver to use
driver
com.mysql.jdbc.Driver
&nbsp;
   Username to login on the database.
username
root
&nbsp;
   Password for the given username.
password
yourpassword
&nbsp;
   JDBC path to database.
database
jdbc:mysql://localhost:3306/xort</pre>
</div>
</div>
<p>Xort up and running:</p>
<p style="text-align: center;"><a href="http://silveiraneto.net/wp-content/uploads/2008/10/xort_running.png"><img class="alignnone size-medium wp-image-1548" title="xort_running" src="http://silveiraneto.net/wp-content/uploads/2008/10/xort_running-500x312.png" alt="" width="500" height="312" /></a></p>
<p><object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/b2Mrk8XfvKk&amp;rel=0&amp;color1=0x3a3a3a&amp;color2=0x999999"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/b2Mrk8XfvKk&amp;rel=0&amp;color1=0x3a3a3a&amp;color2=0x999999" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></object></p>
]]></content:encoded>
			<wfw:commentRss>http://silveiraneto.net/2008/10/21/short-urls-with-glassfishmysql/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Some Sun Student Datasheets</title>
		<link>http://silveiraneto.net/2008/09/10/some-sun-student-datasheets/</link>
		<comments>http://silveiraneto.net/2008/09/10/some-sun-student-datasheets/#comments</comments>
		<pubDate>Wed, 10 Sep 2008 21:02:25 +0000</pubDate>
		<dc:creator>Silveira</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[GlassFish]]></category>
		<category><![CDATA[Lustre]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[netbeans]]></category>
		<category><![CDATA[Opensolaris]]></category>
		<category><![CDATA[SDN]]></category>

		<guid isPermaLink="false">http://silveiraneto.net/?p=1268</guid>
		<description><![CDATA[Some Sun student datasheet posters. Click on the images to download them. Or in those links. glassfish_student_datasheet.pdf lustre_student_datasheet.pdf mysql_student_datasheet.pdf netbeans_students_datasheet.pdf opensolaris_student_datasheet.pdf sun_student_datasheet.pdf]]></description>
			<content:encoded><![CDATA[<p>Some Sun student datasheet posters. Click on the images to download them.</p>
<p><a href="http://silveiraneto.net/wp-content/uploads/2008/09/glassfish_student_datasheet.pdf"><img class="size-full wp-image-1267" title="glassfish" src="http://silveiraneto.net/wp-content/uploads/2008/09/glassfish.png" alt="Glassfish Student Datasheet" width="82" height="104" /></a> <a href="http://silveiraneto.net/wp-content/uploads/2008/09/lustre_student_datasheet.pdf"><img class="size-full wp-image-1270" title="lustre" src="http://silveiraneto.net/wp-content/uploads/2008/09/lustre.png" alt="Lustra Student Datasheet" width="82" height="104" /></a> <a title="MySQL" href="http://silveiraneto.net/wp-content/uploads/2008/09/mysql_student_datasheet.pdf"><img class="alignnone size-full wp-image-1274" title="mysql" src="http://silveiraneto.net/wp-content/uploads/2008/09/mysql.png" alt="" width="82" height="105" /></a> <a href="http://silveiraneto.net/wp-content/uploads/2008/09/netbeans_students_datasheet.pdf"><img class="alignnone size-full wp-image-1275" title="netbeans" src="http://silveiraneto.net/wp-content/uploads/2008/09/netbeans.png" alt="" width="82" height="105" /></a> <a href="http://silveiraneto.net/wp-content/uploads/2008/09/opensolaris_students_datasheet.pdf"><img class="alignnone size-full wp-image-1276" title="opensolaris" src="http://silveiraneto.net/wp-content/uploads/2008/09/opensolaris.png" alt="" width="82" height="105" /></a> <a href="http://silveiraneto.net/wp-content/uploads/2008/09/sun_student_datasheet.pdf"><img class="alignnone size-full wp-image-1277" title="sun" src="http://silveiraneto.net/wp-content/uploads/2008/09/sun.png" alt="" width="82" height="105" /></a></p>
<p>Or in those links.</p>
<ul>
<li><a href="http://silveiraneto.net/wp-content/uploads/2008/09/glassfish_student_datasheet.pdf">glassfish_student_datasheet.pdf</a></li>
<li><a href="http://silveiraneto.net/wp-content/uploads/2008/09/lustre_student_datasheet.pdf">lustre_student_datasheet.pdf</a></li>
<li><a href="http://silveiraneto.net/wp-content/uploads/2008/09/mysql_student_datasheet.pdf">mysql_student_datasheet.pdf</a></li>
<li><a href="http://silveiraneto.net/wp-content/uploads/2008/09/netbeans_students_datasheet.pdf">netbeans_students_datasheet.pdf</a></li>
<li><a href="http://silveiraneto.net/wp-content/uploads/2008/09/opensolaris_student_datasheet.pdf">opensolaris_student_datasheet.pdf</a></li>
<li><a href="http://silveiraneto.net/wp-content/uploads/2008/09/sun_student_datasheet.pdf">sun_student_datasheet.pdf</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://silveiraneto.net/2008/09/10/some-sun-student-datasheets/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Glassfish on Linux</title>
		<link>http://silveiraneto.net/2008/09/07/glassfish-on-linux/</link>
		<comments>http://silveiraneto.net/2008/09/07/glassfish-on-linux/#comments</comments>
		<pubDate>Sun, 07 Sep 2008 17:24:14 +0000</pubDate>
		<dc:creator>Silveira</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[Apache Ant]]></category>
		<category><![CDATA[Cluster]]></category>
		<category><![CDATA[GlassFish]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[J2EE]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Java EE]]></category>
		<category><![CDATA[JEE]]></category>
		<category><![CDATA[Load Balance]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Web development]]></category>
		<category><![CDATA[Web Server]]></category>

		<guid isPermaLink="false">http://silveiraneto.net/?p=1239</guid>
		<description><![CDATA[First, check if you have Java installed: $ java -version java version &#8220;1.6.0_10-rc&#8221; Java(TM) SE Runtime Environment (build 1.6.0_10-rc-b28) Java HotSpot(TM) Client VM (build 11.0-b15, mixed mode, sharing) Now download the last version of Glassfish application server, I&#8217;m using Glassfish V2 for Linux. It&#8217;s a jar package. Execute it. $ java -Xmx256m -jar glassfish-installer-v2ur2-b04-linux.jar You [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="alignnone size-full wp-image-1241" title="Glassfish logo" src="http://silveiraneto.net/wp-content/uploads/2008/09/glassfish_logo_large.gif" alt="" width="212" height="94" /></p>
<p>First, check if you have Java installed:</p>
<blockquote><p>$ java -version<br />
java version &#8220;1.6.0_10-rc&#8221;<br />
Java(TM) SE Runtime Environment (build 1.6.0_10-rc-b28)<br />
Java HotSpot(TM) Client VM (build 11.0-b15, mixed mode, sharing)</p></blockquote>
<p>Now download the last version of <a title="Download glassfish" href="https://glassfish.dev.java.net/downloads">Glassfish application server</a>, I&#8217;m using <a title="Glassfish v2 download" href="https://glassfish.dev.java.net/downloads/v2ur2-b04.html">Glassfish V2</a> for Linux. It&#8217;s a jar package. Execute it.</p>
<blockquote><p>$ java -Xmx256m -jar glassfish-installer-v2ur2-b04-linux.jar</p></blockquote>
<p>You be asked about the license agreement (<a href="https://glassfish.dev.java.net/public/CDDL+GPL.html">CDDL+GPL</a>).</p>
<p style="text-align: center;"><img class="size-full wp-image-1243 aligncenter" title="license" src="http://silveiraneto.net/wp-content/uploads/2008/09/license.png" alt="" width="300" height="249" /></p>
<p>Files will be decompressed in a directory named glassfish.</p>
<blockquote><p>$ cd glassfish</p></blockquote>
<p>Now we need to continue the installation. You can have <a href="http://ant.apache.org/">Ant</a> installed in your system or, like I&#8217;m doing, use a version that comes the Glassfish package.</p>
<blockquote><p>$ chmod +x -R lib/ant/bin<br />
$ lib/ant/bin/ant -f setup.xml</p></blockquote>
<p><strong>Tip:</strong> if you have more servers and want to create a cluster for load balancing, see <a title="Glassfish Cluster" href="https://glassfish.dev.java.net/javaee5/build/GlassFish_LB_Cluster.html">this documentation</a>. After ajust the setup-cluster.xml file you just need to run ant on it.</p>
<p>Let&#8217;s execute the server:</p>
<blockquote><p>$ bin/asadmin start-domain</p></blockquote>
<p>The default instance port is 8080. Try it on <a href="http://localhost:8080/">http://localhost:8080</a>.</p>
<p style="text-align: center;"><img class="size-medium wp-image-1246 aligncenter" title="glassfish_on_8080" src="http://silveiraneto.net/wp-content/uploads/2008/09/glassfish_on_8080.png" alt="" width="400" height="256" /></p>
<p>The default administrator port is 4848. Try it on <a href="http://localhost:4848">http://localhost:4848</a>.</p>
<p style="text-align: center;"><img class="size-full wp-image-1247 aligncenter" title="glassfish_login" src="http://silveiraneto.net/wp-content/uploads/2008/09/glassfish_login.png" alt="" width="400" height="240" /></p>
<p>The default user is <strong>admin</strong> and password is <strong>adminadmin</strong>. Log in.</p>
<p><strong>Tip:</strong> you be asked for register your version. This register is not mandatory and not doing it will not limit the features of your Glassfish. It&#8217;s just a way they use to track the number of users. Aditionaly can have acess to newsletters, tutorials, screencasts, services and support. If you already have a SDN (<em>Sun Developer Network</em>) or <em>Sun Online</em> account you can use it for registration. If you simply doesn&#8217;t want to, you can skip this step.</p>
<p>For security reassons, click in the <em>Application Server</em> icon on the left sidebar and so in the <em>Adminstrator Password</em> tab. Chose a new password and click <em>Save</em>.</p>
<p style="text-align: center;"><img class="size-full wp-image-1248 aligncenter" title="glassfish_password" src="http://silveiraneto.net/wp-content/uploads/2008/09/glassfish_password.png" alt="" width="500" height="359" /></p>
<p>Let&#8217;s deploy a application. Download the file <a title="WAR file" href="http://glassfish.dev.java.net/downloads/quickstart/hello.war">http://glassfish.dev.java.net/downloads/quickstart/hello.war</a>.</p>
<p>Go to <em>Applications</em> → <em>Web Applications</em> on the sidebar.</p>
<p style="text-align: center;"><img class="size-full wp-image-1249 aligncenter" title="glassfish_web_apps" src="http://silveiraneto.net/wp-content/uploads/2008/09/glassfish_web_apps.png" alt="" width="400" height="283" /></p>
<p>No application will be there. Click on the Deploy button.</p>
<p>In the next screen, on <em>Location</em> select the .war that you downloaded. Click <em>Ok</em>.</p>
<p style="text-align: center;"><img class="size-full wp-image-1250 aligncenter" title="glassfish_deploy" src="http://silveiraneto.net/wp-content/uploads/2008/09/glassfish_deploy.png" alt="" width="400" height="284" /></p>
<p>Your application is now deployed.</p>
<p style="text-align: center;"><img class="size-full wp-image-1251 aligncenter" title="glassfish_deployed" src="http://silveiraneto.net/wp-content/uploads/2008/09/glassfish_deployed.png" alt="" width="400" height="287" /></p>
<p>Try the application on <a title="Hello Glassfish" href="http://localhost:8080/hello/">http://localhost:8080/hello</a>.</p>
<p style="text-align: center;"><img class="size-full wp-image-1252 aligncenter" title="glassfish_hello" src="http://silveiraneto.net/wp-content/uploads/2008/09/glassfish_hello.png" alt="" width="400" height="293" /></p>
<p>There other ways  less easy but more flexible) to deploy your application, you can take a look on this and others topics on <a title="Glassfish Quick Start" href="https://glassfish.dev.java.net/downloads/quickstart/index.html">Glassfish Quick Start Guide</a>.</p>
<p>Try to explore the Glassfish admin interface. It&#8217;s very easy and intuitive.</p>
]]></content:encoded>
			<wfw:commentRss>http://silveiraneto.net/2008/09/07/glassfish-on-linux/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>MySQL+Glassfish=U$ !</title>
		<link>http://silveiraneto.net/2008/09/05/mysqlglassfishu/</link>
		<comments>http://silveiraneto.net/2008/09/05/mysqlglassfishu/#comments</comments>
		<pubDate>Fri, 05 Sep 2008 19:00:35 +0000</pubDate>
		<dc:creator>Silveira</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[contest]]></category>
		<category><![CDATA[GlassFish]]></category>
		<category><![CDATA[money]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[pdf]]></category>
		<category><![CDATA[poster]]></category>

		<guid isPermaLink="false">http://silveiraneto.net/?p=1225</guid>
		<description><![CDATA[More information on the blog Students views and reviews or in the contest page. Here the PDF version of this poster.]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="size-full wp-image-1224 aligncenter" title="MYSQL Glassfish Prize" src="http://silveiraneto.net/wp-content/uploads/2008/09/mysql_gf_contest_flier.jpg" alt="" width="500" height="647" /></p>
<p>More information on the blog <a href="http://blogs.sun.com/students/entry/participate_in_mysql_glassfish_student">Students views and reviews</a> or in the <a href="http://www.sun.com/products-n-solutions/reviews/studentzone/contest.jsp">contest page</a>. Here the <a title="PDF Flier" href="http://blogs.sun.com/students/resource/MySQL_GF_Contest_Flier.pdf">PDF version</a> of this poster.</p>
]]></content:encoded>
			<wfw:commentRss>http://silveiraneto.net/2008/09/05/mysqlglassfishu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Anúncio do NetBeans 6.5 Beta</title>
		<link>http://silveiraneto.net/2008/08/13/anuncio-do-netbeans-65-beta/</link>
		<comments>http://silveiraneto.net/2008/08/13/anuncio-do-netbeans-65-beta/#comments</comments>
		<pubDate>Wed, 13 Aug 2008 15:22:19 +0000</pubDate>
		<dc:creator>Silveira</dc:creator>
				<category><![CDATA[português]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[banco de dados]]></category>
		<category><![CDATA[beta]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[GlassFish]]></category>
		<category><![CDATA[Grails]]></category>
		<category><![CDATA[Groovy]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[netbeans]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://silveiraneto.net/?p=1081</guid>
		<description><![CDATA[O Netbeans.org anunciou a disponibilidade do NetBeans IDE 6.5 Beta. Abaixo a tradução do anúncio: O NetBeans IDE 6.5 introduz várias novas funcionalidades, incluindo uma IDE robusta para PHP, deputação de JavaScript para o Firefox e IE, e suporte a Groovy e Grails. Esse lançamento também inclui várias melhorias para o desenvolvimento em Java, Ruby [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a title="Download Now" href="http://download.netbeans.org/netbeans/6.5/beta/"><img class="size-full wp-image-1082 aligncenter" title="netbeans-65-beta" src="http://silveiraneto.net/wp-content/uploads/2008/08/netbeans-65-beta.png" alt="" width="400" height="137" /></a></p>
<p>O <a title="NetBeans" href="http://netbeans.org">Netbeans.org</a> anunciou a disponibilidade do <a title="NetBeans 6.5 Beta" href="http://www.netbeans.org/community/releases/65/">NetBeans IDE 6.5 Beta</a>. Abaixo a tradução do anúncio:</p>
<p>O NetBeans IDE 6.5 introduz várias novas funcionalidades, incluindo uma IDE robusta para PHP, deputação de JavaScript para o Firefox e IE, e suporte a Groovy e Grails. Esse lançamento também inclui várias melhorias para o desenvolvimento em Java, Ruby e Rails, e C/C++. Dentre as melhorias no Java destacam-se: suporte nativo ao Hibernate, importação de projetos do Eclipse, e compilação no salvamento.</p>
<p>Links:</p>
<ul>
<li><a title="Download Now" href="http://download.netbeans.org/netbeans/6.5/beta/">Faça o Download</a></li>
<li><a title="Saiba Mais" href="http://www.netbeans.org/community/releases/65/">Saiba Mais</a></li>
<li><a href="http://www.netbeans.org/kb/index.html">Tutoriais &amp; Documentação</a></li>
</ul>
<p>Outros destaques:</p>
<ul>
<li> PHP
<ul>
<li>Completação de código</li>
<li>Consertos rápidos e checagem semântica</li>
<li>Suporte a FTP</li>
<li>Depuração com Xdebug</li>
<li>Suporte a Web Services populares</li>
</ul>
</li>
<li>Ajax/JavaScript
<ul>
<li>Suporte a depuração no Firefox e IE</li>
<li>Monitoramento cliente de HTTP</li>
<li>Vêm com as bibliotecas mais populares de JavaScript</li>
</ul>
</li>
<li>Java
<ul>
<li>Suporte a Groovy/Grails</li>
<li>Compilação/Deploy no momento do salvamento</li>
<li>Importação e sincronização de projetos do Eclipse</li>
<li>Suporte nativo a Hibernate</li>
<li>Gerador de CRUD JSF agora com Ajax</li>
</ul>
</li>
<li>Banco de Dados
<ul>
<li>Melhorias no editor</li>
</ul>
</li>
<li>C/C++
<ul>
<li>Melhorias na completação de código e destaque de erros</li>
<li>Desenvolvimento remoto</li>
</ul>
</li>
<li>Ruby
<ul>
<li>Suporte aos Testes Ruby</li>
<li>Melhoria no suporte a Rake</li>
</ul>
</li>
<li>GlassFish V3 &#8220;Prelude&#8221;
<ul>
<li>Menor tamanho, inicialização e deployment mais rápido</li>
<li>Suporte a scripting, inclusive jRuby</li>
</ul>
</li>
</ul>
<div id=":vc" class="ArwC7c ckChnd">
<div>
<div lang="x-western">
<p>O NetBeans IDE 6.5 final está planejado para ser lançado em Outubro de 2008. Como sempre, é bem vindo e nós encorajamos seu feedback sobre sua experiência usando a IDE NetBeans. Visite nossas <a href="http://www.netbeans.org/community/lists/top.html">listas de email</a> ou <a href="http://planetnetbeans.org/">faça uma postagem</a> no seu blog.</div>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://silveiraneto.net/2008/08/13/anuncio-do-netbeans-65-beta/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

