<?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>O Blog do Gustavo Felisberto &#187; java</title>
	<atom:link href="http://blog.felisberto.net/tag/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.felisberto.net</link>
	<description>Life, the universe and all the rest</description>
	<lastBuildDate>Tue, 15 Mar 2011 11:57:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Struts 2 under IntelliJ IDEA 8.0M1</title>
		<link>http://blog.felisberto.net/2008/10/03/struts-2-under-intellij-idea-80m1/</link>
		<comments>http://blog.felisberto.net/2008/10/03/struts-2-under-intellij-idea-80m1/#comments</comments>
		<pubDate>Fri, 03 Oct 2008 13:42:56 +0000</pubDate>
		<dc:creator>Gustavo Felisberto</dc:creator>
				<category><![CDATA[Ciência/Tecnologia]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Gentoo-dev]]></category>
		<category><![CDATA[Geral]]></category>
		<category><![CDATA[intellij idea]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[struts 2]]></category>

		<guid isPermaLink="false">http://blog.felisberto.net/?p=1402</guid>
		<description><![CDATA[If you like IDEA and use Struts 2 you can be happy to know that 8.0 release comes with a new Struts 2 plugin. There is a small tutorial on how to use it but it has some errors. First the Action class should extend ActionSupport hand have proper setter methods: package hello; import com.opensymphony.xwork2.ActionSupport; [...]]]></description>
			<content:encoded><![CDATA[<p><span class="dropcap">I</span>f you like IDEA and use Struts 2 you can be happy to know that 8.0 release comes with a new Struts 2 <a href="http://www.jetbrains.net/confluence/display/CONTEST/Struts2Plugin">plugin</a>. There is a <a href="http://beans.seartipy.com/2008/08/20/%E2%80%9Chello-world%E2%80%9D-web-application-using-struts-2-in-intellij-idea-80-m1/">small tutorial</a> on how to use it but it has some errors.<br />
First the Action class should extend ActionSupport hand have proper setter methods:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">hello</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.opensymphony.xwork2.ActionSupport</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> HelloWorld <span style="color: #000000; font-weight: bold;">extends</span> ActionSupport <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">String</span> username<span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">String</span> message<span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">String</span> getMessage<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">return</span> message<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">String</span> execute<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        message <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Hello, &quot;</span> <span style="color: #339933;">+</span> username <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;.&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">return</span> SUCCESS<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">String</span> getUsername<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">return</span> username<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setUsername<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> username<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">username</span> <span style="color: #339933;">=</span> username<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Second the JSP file can have a proper action:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;">&lt; %@ page <span style="color: #000066;">contentType</span>=<span style="color: #ff0000;">&quot;text/html;charset=UTF-8&quot;</span> <span style="color: #000066;">language</span>=<span style="color: #ff0000;">&quot;java&quot;</span> %<span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #009900;">&lt; %@ taglib <span style="color: #000066;">prefix</span>=<span style="color: #ff0000;">&quot;s&quot;</span> <span style="color: #000066;">uri</span>=<span style="color: #ff0000;">&quot;/struts-tags&quot;</span> %<span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;html<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;head<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Simple jsp page<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/title<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/head<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		Struts 2 Message: <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s</span> :property <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;message&quot;</span> <span style="color: #000066;">default</span>=<span style="color: #ff0000;">&quot;Guest.&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s</span> :form <span style="color: #000066;">method</span>=<span style="color: #ff0000;">&quot;GET&quot;</span> <span style="color: #000066;">action</span>=<span style="color: #ff0000;">&quot;HelloWorld&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			Enter your name:<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s</span> :textfield <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;username&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;s</span> :submit <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;Submit&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/s<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/html<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>And finally struts.xml can have the Action declared without the ugly unRESTFUL .action:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;">&lt; ?xml <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
&nbsp;
<span style="color: #009900;">&lt; !DOCTYPE struts PUBLIC</span>
<span style="color: #009900;">  <span style="color: #ff0000;">&quot;-//Apache Software Foundation//DTD Struts Configuration 2.0//EN&quot;</span></span>
<span style="color: #009900;">  <span style="color: #ff0000;">&quot;http://struts.apache.org/dtds/struts-2.0.dtd&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;struts<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;package</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;/&quot;</span> <span style="color: #000066;">extends</span>=<span style="color: #ff0000;">&quot;struts-default&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;action</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;HelloWorld&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;hello.HelloWorld&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;result</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;success&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>/index.jsp<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/result<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/action<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/package<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/struts<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>I really like IDEA when it comes to Java codding, and I can live with the quirks of the Struts 2 support. But one thing that makes me steam is the fact that I have to un-deploy and deploy the application for each change I make. That steals me hours every week.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.felisberto.net/2008/10/03/struts-2-under-intellij-idea-80m1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Assertion `c-&gt;xlib.lock&#8217; failed</title>
		<link>http://blog.felisberto.net/2008/01/29/assertion-c-xliblock-failed/</link>
		<comments>http://blog.felisberto.net/2008/01/29/assertion-c-xliblock-failed/#comments</comments>
		<pubDate>Tue, 29 Jan 2008 23:39:49 +0000</pubDate>
		<dc:creator>Gustavo Felisberto</dc:creator>
				<category><![CDATA[Ciência/Tecnologia]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://blog.felisberto.net/2008/01/29/assertion-c-xliblock-failed/</guid>
		<description><![CDATA[With XCB and java graphical applications on recent distributions one gets: java: xcb_xlib.c:82: xcb_xlib_unlock: Assertion `c->xlib.lock&#8217; failed. This is very well documented (just google a bit). So this serves mostly as a mental note for the way to fix it. $ sed -i &#8216;s/XINERAMA/FAKEEXTN/g&#8217; /opt/sun-jdk-1.6.0.04/jre/lib/i386/xawt/libmawt.so or the libawt.so of your JRE. Remember that many programs [...]]]></description>
			<content:encoded><![CDATA[<p><span class="dropcap">W</span>ith XCB and java graphical applications on recent distributions one gets:</p>
<p>java: xcb_xlib.c:82: xcb_xlib_unlock: Assertion `c->xlib.lock&#8217; failed.</p>
<p>This is very well documented (just google a bit). So this serves mostly as a mental note for the way to fix it.</p>
<p>$ sed -i &#8216;s/XINERAMA/FAKEEXTN/g&#8217; /opt/sun-jdk-1.6.0.04/jre/lib/i386/xawt/libmawt.so</p>
<p>or the libawt.so of your JRE. Remember that many programs may come with they&#8217;re own JRE and not use the one provided by the system.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.felisberto.net/2008/01/29/assertion-c-xliblock-failed/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

