<?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>Source Rebels&#187; Edu</title>
	<atom:link href="http://www.sourcerebels.com/blog/author/admin/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sourcerebels.com/blog</link>
	<description>Por Edu Rodríguez Castillo</description>
	<lastBuildDate>Sat, 03 Jul 2010 06:03:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Maven. Forzar la codificación del código fuente</title>
		<link>http://www.sourcerebels.com/blog/maven-forzar-la-codificacion-del-codigo-fuente/</link>
		<comments>http://www.sourcerebels.com/blog/maven-forzar-la-codificacion-del-codigo-fuente/#comments</comments>
		<pubDate>Thu, 24 Jun 2010 17:06:43 +0000</pubDate>
		<dc:creator>Edu</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Maven]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.sourcerebels.com/blog/?p=373</guid>
		<description><![CDATA[Modificar el fichero pom.xml. En la propiedad project.build.sourceEncoding indicar la codificación que tenga el código fuente. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 &#60;project&#62; &#60;properties&#62; &#60;project.build.sourceEncoding&#62;UTF-8&#60;/project.build.sourceEncoding&#62; &#60;/properties&#62; &#60;build&#62; &#60;plugins&#62; &#60;plugin&#62; &#60;artifactId&#62;maven-compiler-plugin&#60;/artifactId&#62; &#60;configuration&#62; &#60;source&#62;1.6&#60;/source&#62; &#60;target&#62;1.6&#60;/target&#62; &#60;encoding&#62;${project.build.sourceEncoding}&#60;/encoding&#62; &#60;/configuration&#62; &#60;/plugin&#62; &#60;/plugins&#62; &#60;/build&#62; &#60;/project&#62;]]></description>
			<content:encoded><![CDATA[<p>Modificar el fichero pom.xml. En la propiedad project.build.sourceEncoding indicar la codificación que tenga el código fuente.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;project<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;properties<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;project.build.sourceEncoding<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>UTF-8<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/project.build.sourceEncoding<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/properties<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;build<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;plugins<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;plugin<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>maven-compiler-plugin<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;configuration<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;source<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>1.6<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/source<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>1.6<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;encoding<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>${project.build.sourceEncoding}<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/encoding<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/configuration<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/plugin<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/plugins<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/build<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/project<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.sourcerebels.com/blog/maven-forzar-la-codificacion-del-codigo-fuente/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Instalación rápida de Subversion en Linux (APT)</title>
		<link>http://www.sourcerebels.com/blog/instalacion-rapida-de-subversion-en-linux-apt/</link>
		<comments>http://www.sourcerebels.com/blog/instalacion-rapida-de-subversion-en-linux-apt/#comments</comments>
		<pubDate>Thu, 24 Jun 2010 16:41:09 +0000</pubDate>
		<dc:creator>Edu</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[VCS]]></category>

		<guid isPermaLink="false">http://www.sourcerebels.com/blog/?p=370</guid>
		<description><![CDATA[Instalar subversion: # sudo apt-get install subversion Crear la ruta /var/svn: # mkdir /var/svn Instalar apache2 y libapache2-svn: # sudo apt-get install apache2 libapache2-svn Crear el fichero /etc/subversion/passwd y añadir el primer usuario: # htpasswd -c /etc/subversion/passwd user_name Para añadir el resto de usuarios: # htpasswd -c /etc/subversion/passwd user_name Editar /etc/apache2/mods-enabled: &#60;Location /svn&#62; DAV svn [...]]]></description>
			<content:encoded><![CDATA[<p>Instalar subversion:</p>
<pre># sudo apt-get install subversion
</pre>
<p>Crear la ruta /var/svn:</p>
<pre># mkdir /var/svn
</pre>
<p>Instalar apache2 y libapache2-svn:</p>
<pre># sudo apt-get install apache2 libapache2-svn
</pre>
<p>Crear el fichero /etc/subversion/passwd y añadir el primer usuario:</p>
<pre># htpasswd -c /etc/subversion/passwd user_name
</pre>
<p>Para añadir el resto de usuarios:</p>
<pre># htpasswd -c /etc/subversion/passwd user_name
</pre>
<p>Editar /etc/apache2/mods-enabled:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Location</span> /svn<span style="color: #000000; font-weight: bold;">&gt;</span></span>
  DAV svn
  SVNParentPath /var/svn
  AuthType Basic
  AuthName &quot;Subversion Repository&quot;
  AuthUserFile /etc/subversion/passwd
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;LimitExcept</span> GET PROPFIND OPTIONS REPORT<span style="color: #000000; font-weight: bold;">&gt;</span></span>
    Require valid-user
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/LimitExcept<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Location<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Crear los repositorios de subversion:</p>
<pre># svnadmin create /var/svn/repo
# chown -R www-data /var/svn/repo
</pre>
<p>Reiniciar apache2:</p>
<pre># /etc/init.d/apache2 restart
</pre>
<p>Crear la estructura de directorios TTB (Trunk, Tags, Branches):</p>
<pre># svn mkdir http://localhost/svn/repo/trunk  -m "Creating trunk"
# svn mkdir http://localhost/svn/repo/tags  -m "Creating tags"
# svn mkdir http://localhost/svn/repo/branches  -m "Creating branches"
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.sourcerebels.com/blog/instalacion-rapida-de-subversion-en-linux-apt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spring MVC y Spring Security</title>
		<link>http://www.sourcerebels.com/blog/spring-mvc-y-spring-security/</link>
		<comments>http://www.sourcerebels.com/blog/spring-mvc-y-spring-security/#comments</comments>
		<pubDate>Sun, 13 Jun 2010 09:13:59 +0000</pubDate>
		<dc:creator>Edu</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[Spring MVC]]></category>

		<guid isPermaLink="false">http://www.sourcerebels.com/blog/?p=353</guid>
		<description><![CDATA[En este post voy a explicar cómo proteger una aplicación Spring MVC utilizando el módulo Spring Security. Se trata de una guía muy ràpida y para nada seria. Se parte de la base de que tenemos un proyecto web Maven recien generado Dependencias a añadir al fichero pom.xml de Maven. 1 2 3 4 5 [...]]]></description>
			<content:encoded><![CDATA[<p>En este post voy a explicar cómo proteger una aplicación Spring MVC utilizando el módulo Spring Security. Se trata de una guía muy ràpida y para nada seria. Se parte de la base de que tenemos un <a href="http://maven.apache.org/guides/mini/guide-webapp.html">proyecto web Maven</a> recien generado <img src='http://www.sourcerebels.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Dependencias a añadir al fichero pom.xml de Maven.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;">        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>org.springframework<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>spring<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2.5.6.SEC01<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>org.springframework<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>spring-webmvc<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2.5.6.SEC01<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>commons-lang<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>commons-lang<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2.4<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>javax.servlet<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>servlet-api<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2.5<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>org.springframework.security<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>spring-security-core<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2.0.5.RELEASE<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;type<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>jar<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/type<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;scope<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>compile<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/scope<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>Modificaciones de /WEB-INF/web.xml</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;">&nbsp;
    <span style="color: #808080; font-style: italic;">&lt;!-- Listener que inicializa el contexto de Spring --&gt;</span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;listener<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;listener-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>org.springframework.web.context.ContextLoaderListener<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/listener-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/listener<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #808080; font-style: italic;">&lt;!-- Ubicación del fichero de configuración de Spring --&gt;</span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;context-param<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;param-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>contextConfigLocation<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/param-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;param-value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/WEB-INF/applicationContext.xml<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/param-value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/context-param<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #808080; font-style: italic;">&lt;!-- Dispatcher Servlet --&gt;</span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>springapp<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>org.springframework.web.servlet.DispatcherServlet<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;load-on-startup<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/load-on-startup<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet-mapping<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>springapp<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;url-pattern<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>*.htm<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/url-pattern<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet-mapping<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #808080; font-style: italic;">&lt;!-- Filtro de Spring Security que intercepta las llamadas a las URL de</span>
<span style="color: #808080; font-style: italic;">         la aplicación --&gt;</span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>springSecurityFilterChain<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>org.springframework.web.filter.DelegatingFilterProxy<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter-mapping<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>springSecurityFilterChain<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;url-pattern<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/*<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/url-pattern<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter-mapping<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>Contenido de /WEB-INF/applicationContext.xml</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <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>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;beans</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://www.springframework.org/schema/beans&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">xmlns:xsi</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">xmlns:p</span>=<span style="color: #ff0000;">&quot;http://www.springframework.org/schema/p&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">xmlns:context</span>=<span style="color: #ff0000;">&quot;http://www.springframework.org/schema/context&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">xmlns:security</span>=<span style="color: #ff0000;">&quot;http://www.springframework.org/schema/security&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">xsi:schemaLocation</span>=<span style="color: #ff0000;">&quot;</span>
<span style="color: #009900;">        http://www.springframework.org/schema/beans </span>
<span style="color: #009900;">        http://www.springframework.org/schema/beans/spring-beans-2.5.xsd</span>
<span style="color: #009900;">        http://www.springframework.org/schema/context </span>
<span style="color: #009900;">        http://www.springframework.org/schema/context/spring-context-2.5.xsd</span>
<span style="color: #009900;">        http://www.springframework.org/schema/security</span>
<span style="color: #009900;">        http://www.springframework.org/schema/security/spring-security-2.0.4.xsd&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
    <span style="color: #808080; font-style: italic;">&lt;!-- Configuración del acceso a las diferentes URL de la aplicación en función del</span>
<span style="color: #808080; font-style: italic;">         rol del usuario. En este caso toda la aplicación está protegida y se requiere</span>
<span style="color: #808080; font-style: italic;">         de un usuario con rol ROLE_USER para acceder --&gt;</span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;security:http</span> <span style="color: #000066;">auto-config</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;security:intercept-url</span> <span style="color: #000066;">pattern</span>=<span style="color: #ff0000;">&quot;/**&quot;</span> <span style="color: #000066;">access</span>=<span style="color: #ff0000;">&quot;ROLE_USER&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/security:http<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #808080; font-style: italic;">&lt;!-- Algunos usuarios de prueba. Posteriormente podremos cambiar el servicio para</span>
<span style="color: #808080; font-style: italic;">         que vaya a buscar la información de los usuarios a otro lugar (BBDD) --&gt;</span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;security:authentication-provider<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;security:user-service<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;security:user</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;admin&quot;</span> <span style="color: #000066;">password</span>=<span style="color: #ff0000;">&quot;admin&quot;</span> <span style="color: #000066;">authorities</span>=<span style="color: #ff0000;">&quot;ROLE_USER, ROLE_ADMIN&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;security:user</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;user1&quot;</span> <span style="color: #000066;">password</span>=<span style="color: #ff0000;">&quot;user1&quot;</span> <span style="color: #000066;">authorities</span>=<span style="color: #ff0000;">&quot;ROLE_USER&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;security:user</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;user1&quot;</span> <span style="color: #000066;">password</span>=<span style="color: #ff0000;">&quot;user1&quot;</span> <span style="color: #000066;">authorities</span>=<span style="color: #ff0000;">&quot;ROLE_USER&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/security:user-service<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/security:authentication-provider<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/beans<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>Una vez hecho esto, al acceder a cualquier recurso de la aplicación se nos mostrará la pantalla de login por defecto de Spring Security. Otro día veremos cómo personalizar esta página de login. Os dejo con una captura de la página:</p>
<p><a href="http://www.sourcerebels.com/blog/wp-content/uploads/2010/06/spring-security-mvc-login-screen.png"><img src="http://www.sourcerebels.com/blog/wp-content/uploads/2010/06/spring-security-mvc-login-screen.png" alt="" title="spring-security-mvc-login-screen" width="444" height="315" class="aligncenter size-full wp-image-357" /></a></p>
<p>Un saludo</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sourcerebels.com/blog/spring-mvc-y-spring-security/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pair Programming</title>
		<link>http://www.sourcerebels.com/blog/pair-programming/</link>
		<comments>http://www.sourcerebels.com/blog/pair-programming/#comments</comments>
		<pubDate>Sun, 06 Jun 2010 11:25:15 +0000</pubDate>
		<dc:creator>Edu</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[Best-Practices]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Opinion]]></category>
		<category><![CDATA[XP]]></category>

		<guid isPermaLink="false">http://www.sourcerebels.com/blog/?p=346</guid>
		<description><![CDATA[¿Por qué no se practica pair-programming (programación por parejas) en las empresas? Las ventajas, pensándolo detenidamente 5 minutos saltan a la vista: Cuatro ojos ven más que dos. Esto es evidente. El código generado es de mucha más calidad. El hecho de que alguien supervise directamente nuestro trabajo (nuestra pareja de programación) influye en que [...]]]></description>
			<content:encoded><![CDATA[<p>¿Por qué no se practica pair-programming (programación por parejas) en las empresas?</p>
<p>Las ventajas, pensándolo detenidamente 5 minutos saltan a la vista:</p>
<ul>
<li>Cuatro ojos ven más que dos. Esto es evidente. El código generado es de mucha más calidad.</li>
<li>El hecho de que alguien supervise directamente nuestro trabajo (nuestra pareja de programación) influye en que nos esforcemos más.</li>
<li>Dos personas comparten la responsabilidad de una tarea. El stress es menor.</li>
<li>Mejora las relaciones de equipo.</li>
<li>Amplifica la transmisión del conocimiento.</li>
</ul>
<p>La excusa para no utilizarla que siempre he escuchado es la misma:</p>
<blockquote><p>&#8220;¿Cómo voy a tener a dos personas haciendo una tarea cuando podría hacerla una única persona?&#8221;.</p></blockquote>
<p>Normalmente esta gente suele ser la misma que ve a los programadores, no como una persona o un profesional, sino como un gasto en la cuenta de su proyecto y mi consejo: alejate de esta gente como de la peste <img src='http://www.sourcerebels.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.sourcerebels.com/blog/pair-programming/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Integración rápida de Maven con Hudson y Archiva</title>
		<link>http://www.sourcerebels.com/blog/integracion-rapida-de-maven-con-apache-hudson-y-apache-archiva/</link>
		<comments>http://www.sourcerebels.com/blog/integracion-rapida-de-maven-con-apache-hudson-y-apache-archiva/#comments</comments>
		<pubDate>Sun, 06 Jun 2010 06:14:54 +0000</pubDate>
		<dc:creator>Edu</dc:creator>
				<category><![CDATA[Archiva]]></category>
		<category><![CDATA[Continuous-Integration]]></category>
		<category><![CDATA[Hudson]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Maven]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.sourcerebels.com/blog/?p=317</guid>
		<description><![CDATA[Supongamos que tenemos un proyecto dividido en varios módulos de funcionalidad y que cada módulo de funcionalidad genera un artefacto. Por ejemplo: core.jar: Almacena la lógica de negocio común. web.war: Aplicación web que hace uso de la lógica de negocio (utiliza core.jar). Cada vez que modificamos la lógica de negocio subiendo código al gestor de [...]]]></description>
			<content:encoded><![CDATA[<p>Supongamos que tenemos un proyecto dividido en varios módulos de funcionalidad y que cada módulo de funcionalidad genera un artefacto. Por ejemplo:</p>
<ul>
<li>core.jar: Almacena la lógica de negocio común.</li>
<li>web.war: Aplicación web que hace uso de la lógica de negocio (utiliza core.jar).</li>
</ul>
<p>Cada vez que modificamos la lógica de negocio subiendo código al gestor de versiones y se genere un artefacto core.jar queremos que se genere un nuevo artefacto web.war que incluya las modificaciones de el primero. Esto lo podemos conseguir fácilmente con Hudson, Maven y Archiva. Partimos de la base que tenemos el servidor Hudson montado y que tenemos dos proyectos definidos &#8220;core&#8221; y &#8220;web&#8221;. Ambos proyectos funcionan con Maven.</p>
<p><strong>Instalación y arranque rápido de Apache archiva:</strong></p>
<ul>
<li>Descargar y descomprimir Apache Archiva en la máquina que vaya a hacer de servidor de repositorios Maven. En mi caso es la misma máquina dónde se encuentra Hudson.</li>
<li>Ejecutar Apache Archiva:</li>
</ul>
<pre>
# $ARCHIVA_HOME/bin/archiva console
</pre>
<ul>
<li>Definir los repositorios que consideremos oportunos y usuarios con perfil &#8220;Repository Manager&#8221;. En mi caso trabajaré con el repositorio &#8220;snapshots&#8221; que viene definido por defecto.</li>
</ul>
<p><strong>Configuración Maven:</strong></p>
<ul>
<li>Editar el fichero pom.xml de todos los proyectos y añadir el repositorio archiva:</li>
</ul>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;repositories<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	...
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;repository<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>archiva.snapshots<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;url<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>http://localhost:8081/archiva/repository/snapshots/<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/url<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;releases<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;enabled<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>false<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/enabled<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/releases<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;snapshots<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;enabled<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/enabled<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/snapshots<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/repository<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	...
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/repositories<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<ul>
<li>Editar el fichero pom.xml del proyecto web y añadir la dependencia al proyecto core, por ejemplo:</li>
</ul>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>com.sourcerebels<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>core<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>0.0.1-SNAPSHOT<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<ul>
<li>Editar el fichero de configuración de Maven (settings.xml):</li>
</ul>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servers<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	...
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;server<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>archiva.internal<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;username<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>usuario_archiva<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/username<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;password<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>password_archiva<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/password<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/server<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;server<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>archiva.snapshots<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;username<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>usuario_archiva<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/username<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;password<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>password_archiva<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/password<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/server<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	...
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servers<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p><strong>Configuración Hudson:</strong></p>
<ul>
<li>Para cada uno de los artefactos del proyecto configuraremos que se despliegue en el repositorio &#8220;archiva.snapshots&#8221;:</li>
</ul>
<p><a href="http://www.sourcerebels.com/blog/wp-content/uploads/2010/06/hudson_config_archiva.png"><img class="alignleft size-full wp-image-327" title="hudson_config_archiva" src="http://www.sourcerebels.com/blog/wp-content/uploads/2010/06/hudson_config_archiva.png" alt="" width="595" height="313" /></a></p>
<ul>
<li>Con este punto conseguiremos que cada vez que se genere una nueva versión del fichero core.jar esta se archive en el repositorio Maven. Ahora para que el proyecto web se construya cuando alguno de los snapshots de los que depende sean construidos:</li>
</ul>
<p><a href="http://www.sourcerebels.com/blog/wp-content/uploads/2010/06/hudson_config_dependencias.png"><img class="size-full wp-image-324 alignleft" title="hudson_config_dependencias" src="http://www.sourcerebels.com/blog/wp-content/uploads/2010/06/hudson_config_dependencias.png" alt="" width="595" height="58" /></a></p>
<ul>
<br/><br/><br />
Esto es todo <img src='http://www.sourcerebels.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.sourcerebels.com/blog/integracion-rapida-de-maven-con-apache-hudson-y-apache-archiva/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nueva etapa</title>
		<link>http://www.sourcerebels.com/blog/nueva-etapa/</link>
		<comments>http://www.sourcerebels.com/blog/nueva-etapa/#comments</comments>
		<pubDate>Tue, 23 Mar 2010 08:37:17 +0000</pubDate>
		<dc:creator>Edu</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.sourcerebels.com/blog/?p=311</guid>
		<description><![CDATA[Por fin, después de casi 9 años en Indra (anteriormente Soluziona), cambio de lugar de trabajo. Por ahora no adelantaré mucho. Voy al departamento de movilidad de una empresa mucho más pequeña y más orientada hacia el Open-Source. Por este motivo quizás, las entradas que vaya escribiendo tengan que ver con tecnologías diferentes a las [...]]]></description>
			<content:encoded><![CDATA[<p>Por fin, después de casi 9 años en Indra (anteriormente Soluziona), cambio de lugar de trabajo. Por ahora no adelantaré mucho. Voy al departamento de movilidad de una empresa mucho más pequeña y más orientada hacia el Open-Source. Por este motivo quizás, las entradas que vaya escribiendo tengan que ver con tecnologías diferentes a las que estoy acostumbrado a utilizar.</p>
<p>Nunca se sabe. Ya iremos viendo y escribiendo por aquí lo que vaya aprendiendo, así como las cosas que me llamen la atención sobre esta nueva aventurilla <img src='http://www.sourcerebels.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Un saludo a todos</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sourcerebels.com/blog/nueva-etapa/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Atajos de teclado en Eclipse</title>
		<link>http://www.sourcerebels.com/blog/atajos-de-teclado-en-eclipse/</link>
		<comments>http://www.sourcerebels.com/blog/atajos-de-teclado-en-eclipse/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 21:47:05 +0000</pubDate>
		<dc:creator>Edu</dc:creator>
				<category><![CDATA[Best-Practices]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.sourcerebels.com/blog/?p=277</guid>
		<description><![CDATA[Estos son algunos de los atajos de teclado que me facilitan un poquito más el día a día cuando utilizo Eclipse para escribir código Java. No he querido abusar por que los considero bastante engorrosos de aprender pero si te interesa esto siempre puedes pulsar Ctrl+Shift+L e indicarme tus preferidos Ctrl+Alt+H &#8211; Mostrar la jerarquía [...]]]></description>
			<content:encoded><![CDATA[<p>Estos son algunos de los atajos de teclado que me facilitan un poquito más el día a día cuando utilizo Eclipse para escribir código Java. No he querido abusar por que los considero bastante engorrosos de aprender pero si te interesa esto siempre puedes pulsar Ctrl+Shift+L e indicarme tus preferidos <img src='http://www.sourcerebels.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p><strong>Ctrl+Alt+H &#8211; Mostrar la jerarquía de llamadas de un método</strong></p>
<p>Si presionamos esta combinación de teclas se nos mostrará una pantalla donde, a modo de árbol, podremos inspeccionar toda la jerarquía de llamadas de un método, esto es, qué otros métodos le llaman, que otros métodos llaman a estos últimos y así sucesivamente. Haciendo click en cualquiera de los resultados, abriremos un editor directamente en el código.</p>
<p style="text-align: center;"><a href="http://www.sourcerebels.com/blog/wp-content/uploads/2010/02/eclipse_atajos_ctrlalth.png"><img class="aligncenter size-full wp-image-303" title="eclipse_atajos_ctrlalth" src="http://www.sourcerebels.com/blog/wp-content/uploads/2010/02/eclipse_atajos_ctrlalth.png" alt="" width="655" height="276" /></a></p>
<p><strong>Alt+Shift+P &#8211; Abrir fichero Maven pom.xml</strong></p>
<p>Esta combinación de teclas sirve para buscar el fichero pom.xml de cualquier artefacto tanto en el workspace como en cualquiera de los repositorios maven2 que tengamos definidos.</p>
<p style="text-align: center;"><a href="http://www.sourcerebels.com/blog/wp-content/uploads/2010/02/eclipse_atajos_altshiftp.png"><img class="aligncenter size-full wp-image-298" title="eclipse_atajos_altshiftp" src="http://www.sourcerebels.com/blog/wp-content/uploads/2010/02/eclipse_atajos_altshiftp.png" alt="" width="384" height="360" /></a></p>
<p><strong>Nota:</strong> Si no me equivoco, esta combinación sólo está disponible si utilizas el plug-in de integración de Apache Maven 2 m2eclipse.</p>
<p><strong>Ctrl+Shift+G &#8211; Buscar texto en workspace</strong></p>
<p>La siguiente combinación de teclas permite buscar rápidamente el texto seleccionado en todo el workspace. La ventana de resultados sería similar a esta.</p>
<p style="text-align: center;"><a href="http://www.sourcerebels.com/blog/wp-content/uploads/2010/02/eclipse_atajos_ctrlaltg1.png"><img class="aligncenter size-full wp-image-295" title="eclipse_atajos_ctrlaltg" src="http://www.sourcerebels.com/blog/wp-content/uploads/2010/02/eclipse_atajos_ctrlaltg1.png" alt="" width="629" height="150" /></a></p>
<p><strong>Ctrl+Shift+R / Ctrl+Shift+T &#8211; Abrir recurso / Abrir tipo</strong></p>
<p>En el caso de Ctrl+Shift+R Muestra un cuadro de dialogo donde podemos teclear un texto y que permite filtrar rápidamente un fichero de los proyectos que tengamos abiertos en ese momento en el workspace. El funcionamiento de Ctrl+Shift+T es similar al de Ctrl+Shif+R sólo que en este caso podemos abrir tipos de Java únicamente.</p>
<p><a href="http://www.sourcerebels.com/blog/wp-content/uploads/2010/02/eclipse_atajos_ctrlshiftrctrlshiftt.png"><img class="aligncenter size-full wp-image-279" title="eclipse_atajos_ctrlshiftrctrlshiftt" src="http://www.sourcerebels.com/blog/wp-content/uploads/2010/02/eclipse_atajos_ctrlshiftrctrlshiftt.png" alt="" width="480" height="400" /></a><br />
<strong>Nota: </strong>Abrir tipo funciona únicamente, al menos a mi, en la perspectiva Java o J2EE</p>
<p><strong>F4 &#8211; Mostrar la jerarquía de un tipo</strong></p>
<p><strong><span style="font-weight: normal;">Sitúa el cursor sobre un tipo en un código Java, pulsa F4 y te aparecerá una pantalla (en mi configuración de Eclipse la de más a la izquierda). Esta pantalla permite ver la jerarquía de herencia de una clase Java (parte superior) así como la lista de propiedades y métodos de la misma clase (parte inferior).</span></strong></p>
<p style="text-align: center;"><a href="http://www.sourcerebels.com/blog/wp-content/uploads/2010/02/eclipse_atajos_f4.png"><img class="aligncenter size-full wp-image-278" title="eclipse_atajos_f4" src="http://www.sourcerebels.com/blog/wp-content/uploads/2010/02/eclipse_atajos_f4.png" alt="" width="575" height="580" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sourcerebels.com/blog/atajos-de-teclado-en-eclipse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Control de versiones con Git</title>
		<link>http://www.sourcerebels.com/blog/control-de-versiones-con-git/</link>
		<comments>http://www.sourcerebels.com/blog/control-de-versiones-con-git/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 12:34:16 +0000</pubDate>
		<dc:creator>Edu</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[VCS]]></category>

		<guid isPermaLink="false">http://www.sourcerebels.com/blog/?p=260</guid>
		<description><![CDATA[Últimamente ando bastante engorilado con Git, por lo que este post pretende ser una introducción muy rápida de las cuatro cosillas que estoy aprendiendo sobre este VCS estos días. En siguientes entradas, o lo que es lo mismo sólo $DEITY sabe cuando, muy probablemente escribiré como montar un repositorio Git utilizando el servicio gratuito ofrecido por github.com. En primer lugar [...]]]></description>
			<content:encoded><![CDATA[<p>Últimamente ando bastante engorilado con <a title="Git VCS" href="http://git-scm.com/" target="_blank">Git</a>, por lo que este post pretende ser una introducción muy rápida de las cuatro cosillas que estoy aprendiendo sobre este <a title="VCS" href="http://en.wikipedia.org/wiki/Revision_control" target="_blank">VCS</a> estos días. En siguientes entradas, o lo que es lo mismo sólo $DEITY sabe cuando, muy probablemente escribiré como montar un repositorio Git utilizando el servicio gratuito ofrecido por <a title="Github.com" href="http://www.github.com/" target="_blank">github.com</a>.</p>
<p>En primer lugar indicar que Git es un sistema distribuido, a diferencia de por ejemplo Subversion o CVS que son centralizados. Esto para nosotros qué quiere decir? Básicamente que no trabajamos con una copia local del código fuente sino con una copia local o clon del repositorio original, más conocido como &#8220;master&#8221;.<br />
Las ventajas más importante de trabajar de esta forma, siempre bajo mi punto de vista, son que disponemos de todas las utilidades propias del VCS sin ni siquiera tener que estar conectado a una red. Muy útil para acceder al historico de modificaciones de un fichero, comparar versiones, hacer un commit o cualquier cosa que hagas normalmente con tu VCS desde un sitio donde no dispongas de conexión.</p>
<p>Git define también 5 tipos de objetos alguno de los cuales nos serán familiares si hemos trabajado con un VCS antes:</p>
<ul>
<li><strong>Blob:</strong> El contenido de un fichero gestionado por Git e identificable por el Hash SHA1 que se obtiene del dicho contenido.</li>
<li><strong>Tree:</strong> La estructura del repositorio en un momento determinado (normalmente un commit). Un objeto de tipo Tree tiene N objetos de tipo Blob asociados.</li>
<li><strong>Commit:</strong> Una &#8220;foto&#8221; del repositorio una vez se han introducido una serie de cambios. Un objeto de tipo commit tiene 1 objeto de tipo Tree asociado.</li>
<li><strong>Tag:</strong> Una etiqueta, normalmente sirve para marcar objetos de tipo commit.</li>
<li><strong>Índice:</strong> Imagen de los cambios que se aplicarán al repositorio en el siguiente commit. En Git, por defecto sólo aplican aquellos cambios que se encuentran reflejados en este índice (están STAGED).</li>
</ul>
<p>Git a diferencia que otros VCS como Subversion no almacena únicamente los cambios de un fichero sino que almacena el contenido completo de cada revisión. Esto sumado a la forma de trabajar que tiene con los objetos que indiqué antes hacen que en general el funcionamiento de Git sea muy ágil y, bajo mi punto de vista, mucho menos susceptible a error (piensa que cada vez que le pides una revisión en concreto, Git no debe &#8220;montarla&#8221; sólo &#8220;localizarla&#8221;).</p>
<p>Sólo por estas cosillas, ya comienzo a estar tentado de cambiar. ¿Habeis trabajado con Git o similar? ¿Qué os parece? ¿Cambiaríais vuestro Subversion/CVS?</p>
<p>Por cierto el libro que estoy leyendo es &#8220;<a title="Version Control with Git" href="http://oreilly.com/catalog/9780596520137" target="_blank">Version Control with Git</a>&#8221; de la editorial O&#8217;Reilly Media por si alguien quiere echarle una leída.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sourcerebels.com/blog/control-de-versiones-con-git/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My top recomentations for new programmers</title>
		<link>http://www.sourcerebels.com/blog/my-top-recomentations-for-new-programmers/</link>
		<comments>http://www.sourcerebels.com/blog/my-top-recomentations-for-new-programmers/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 11:00:26 +0000</pubDate>
		<dc:creator>Edu</dc:creator>
				<category><![CDATA[Best-Practices]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.sourcerebels.com/blog/?p=250</guid>
		<description><![CDATA[Unsorted list: If you use a versioning control system, spend some time learning its basic usage (checkout, checkin, update, diff, merge, &#8230;). If you don&#8217;t use it, go quickly to get one. Im currently using svn and git. Don&#8217;t be scared about refactoring your code. Write your own documentation. Document your work for your personal [...]]]></description>
			<content:encoded><![CDATA[<p>Unsorted list:</p>
<ul>
<li>If you use a versioning control system, spend some time learning its basic usage (checkout, checkin, update, diff, merge, &#8230;). If you don&#8217;t use it, go quickly to get one. Im currently using <a title="Subversion" href="http://subversion.tigris.org/" target="_blank">svn</a> and <a title="Git" href="http://git-scm.com/" target="_blank">git</a>.</li>
</ul>
<ul>
<li>Don&#8217;t be scared about <a title="Code refactoring" href="http://en.wikipedia.org/wiki/Refactoring" target="_blank">refactoring</a> your code.</li>
</ul>
<ul>
<li>Write your own documentation. Document your work for your personal profit. While you are documenting and organizing you are thinking in your job by looking it from a different point of view. Think in documentation like in a software-piece, it must be useful and reusable.</li>
</ul>
<ul>
<li>Constantly, try to improve your knowledge about every day tools usage by knowing its internals (keyboard shorcuts or processes) or just learning from your colleages (or Internet users) usage.</li>
</ul>
<ul>
<li>Write <a title="Test automation" href="http://en.wikipedia.org/wiki/Automated_testing" target="_blank">automated tests</a> and execute it. You can use <a title="Continuous Integration" href="http://martinfowler.com/articles/continuousIntegration.html" target="_blank">continuous integration</a> for doing the job. I like the <a title="Hudson" href="http://hudson-ci.org/" target="_blank">Hudson CI server</a>.</li>
</ul>
<ul>
<li>Don&#8217;t be IDE-dependent for your compilation, use scripts or tools specifically designed for this task. Actually <a title="Apache Maven" href="http://maven.apache.org/" target="_blank">Maven</a> will be my first choice because Java is my main plattform.</li>
</ul>
<ul>
<li>Get feedback about your code. Show them into colleagues or use communities like <a title="StackOverflow" href="http://stackoverflow.com/" target="_blank">StackOverflow</a>.</li>
</ul>
<ul>
<li>Learn what <a title="KISS" href="http://en.wikipedia.org/wiki/KISS_principle" target="_blank">KISS</a> and <a title="Convention over configuration" href="http://en.wikipedia.org/wiki/Convention_over_configuration" target="_blank">Convention over configuration</a> means. Be aware about <a title="Overengineering" href="http://en.wikipedia.org/wiki/Overengineering" target="_blank">overengineering</a>.</li>
</ul>
<ul>
<li>Don&#8217;t try to write your own framework or libraries for later use. Learn writing it  if you want, but use well-known community libraries or frameworks. I personally work mainly with <a title="Spring Framework" href="http://www.springsource.org/" target="_blank">Spring Framework</a> and Apache commons.</li>
</ul>
<ul>
<li>Backup your data. Use your own/preferred method. I personally like <a title="Dropbox" href="https://www.dropbox.com/" target="_blank">dropbox</a>.</li>
</ul>
<ul>
<li>Most important. Don&#8217;t try to acomplish all of this at same time. Just be patient and <img src='http://www.sourcerebels.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </li>
</ul>
<p>Please, feedback <img src='http://www.sourcerebels.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.sourcerebels.com/blog/my-top-recomentations-for-new-programmers/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Spring Annotations Inject properties / Anotaciones Spring Inyectar properties</title>
		<link>http://www.sourcerebels.com/blog/spring-annotations-inject-properties-anotaciones-spring-inyectar-properties/</link>
		<comments>http://www.sourcerebels.com/blog/spring-annotations-inject-properties-anotaciones-spring-inyectar-properties/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 23:24:47 +0000</pubDate>
		<dc:creator>Edu</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Spring]]></category>

		<guid isPermaLink="false">http://www.sourcerebels.com/blog/?p=239</guid>
		<description><![CDATA[applicationContext.xml: File parameters.properties / Fichero parameters.properties: MyComponent.path=/some/path Spring component / Componente gestionado por Spring: import javax.annotation.PostConstruct; import org.springframework.stereotype.Component; &#160; @Component&#40;&#34;MyComponent&#34;&#41; public class MyComponent &#123; &#160; private String path; &#160; @PostConstruct public void loadPath&#40;&#41; &#123; &#160; System.out.println&#40;&#34;Loading from &#34; + this.path&#41;; &#125; &#160; public String getPath&#40;&#41; &#123; return path; &#125; &#160; public void setPath&#40;String path&#41; &#123; [...]]]></description>
			<content:encoded><![CDATA[<p>applicationContext.xml:</p>
<p>File parameters.properties / Fichero parameters.properties:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">MyComponent.<span style="color: #006633;">path</span><span style="color: #339933;">=/</span>some<span style="color: #339933;">/</span>path</pre></div></div>

<p>Spring component / Componente gestionado por Spring:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.annotation.PostConstruct</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.springframework.stereotype.Component</span><span style="color: #339933;">;</span>
&nbsp;
@<span style="color: #003399;">Component</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;MyComponent&quot;</span><span style="color: #009900;">&#41;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> MyComponent <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">String</span> path<span style="color: #339933;">;</span>
&nbsp;
    @PostConstruct
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> loadPath<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
        <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Loading from &quot;</span> <span style="color: #339933;">+</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">path</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">String</span> getPath<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> path<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setPath<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> path<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;">path</span> <span style="color: #339933;">=</span> path<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.sourcerebels.com/blog/spring-annotations-inject-properties-anotaciones-spring-inyectar-properties/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple Javascript call from Java / Llamada simple a Javascript desde Java</title>
		<link>http://www.sourcerebels.com/blog/simple-javascript-call-from-java-llamada-simple-a-javascript-desde-java/</link>
		<comments>http://www.sourcerebels.com/blog/simple-javascript-call-from-java-llamada-simple-a-javascript-desde-java/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 21:45:14 +0000</pubDate>
		<dc:creator>Edu</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Scripting]]></category>

		<guid isPermaLink="false">http://www.sourcerebels.com/blog/?p=235</guid>
		<description><![CDATA[Simple call / Llamada simple: 1 2 3 4 5 6 7 8 9 10 11 try &#123; ScriptEngineManager factory = new ScriptEngineManager&#40;&#41;; ScriptEngine engine = factory.getEngineByName&#40;&#34;JavaScript&#34;&#41;; &#160; //Simple call to println javascript function engine.eval&#40;&#34;println('Texto JavaScript')&#34;&#41;; &#160; &#125; catch &#40;ScriptException ex&#41; &#123; &#160; //Do something &#125; Calling a function / Llamando a una función: 1 [...]]]></description>
			<content:encoded><![CDATA[<p>Simple call / Llamada simple:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
	ScriptEngineManager factory <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ScriptEngineManager<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	ScriptEngine engine <span style="color: #339933;">=</span> factory.<span style="color: #006633;">getEngineByName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;JavaScript&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">//Simple call to println javascript function </span>
	engine.<span style="color: #006633;">eval</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;println('Texto JavaScript')&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span>ScriptException ex<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">//Do something</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Calling a function / Llamando a una función:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
&nbsp;
	ScriptEngineManager factory <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ScriptEngineManager<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	ScriptEngine engine <span style="color: #339933;">=</span> factory.<span style="color: #006633;">getEngineByName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;JavaScript&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	engine.<span style="color: #006633;">eval</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;function amessagefunction(atext){ return 'The secret message is ' + atext;}&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	Invocable invocable <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>Invocable<span style="color: #009900;">&#41;</span> engine<span style="color: #339933;">;</span>
	<span style="color: #003399;">Object</span> object <span style="color: #339933;">=</span> invocable.<span style="color: #006633;">invokeFunction</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;amessagefunction&quot;</span>, <span style="color: #0000ff;">&quot;abc&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>object<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">NoSuchMethodException</span> ex<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">//Do something</span>
&nbsp;
<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span>ScriptException ex<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">//Something is wrong, perhaps</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.sourcerebels.com/blog/simple-javascript-call-from-java-llamada-simple-a-javascript-desde-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Terminator. Terminal Emulator</title>
		<link>http://www.sourcerebels.com/blog/terminator-terminal-emulator/</link>
		<comments>http://www.sourcerebels.com/blog/terminator-terminal-emulator/#comments</comments>
		<pubDate>Sun, 29 Nov 2009 11:06:34 +0000</pubDate>
		<dc:creator>Edu</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.sourcerebels.com/blog/?p=229</guid>
		<description><![CDATA[Cool terminal emulator for GNU/Linux users. I installed on my Ubuntu box just typping: $ sudo apt-get update $ sudo apt-get install terminator Looks like this:]]></description>
			<content:encoded><![CDATA[<p>Cool terminal emulator for GNU/Linux users.</p>
<p>I installed on my Ubuntu box just typping:</p>
<pre>$ sudo apt-get update
$ sudo apt-get install terminator</pre>
<p>Looks like this:</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-230" title="Pantallazo-edu@somachigun: ~ - Terminator" src="http://www.sourcerebels.com/blog/wp-content/uploads/2009/11/Pantallazo-edu@somachigun-Terminator.png" alt="Pantallazo-edu@somachigun: ~ - Terminator" width="582" height="287" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sourcerebels.com/blog/terminator-terminal-emulator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple Spring Proxy</title>
		<link>http://www.sourcerebels.com/blog/simple-spring-proxy/</link>
		<comments>http://www.sourcerebels.com/blog/simple-spring-proxy/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 20:04:00 +0000</pubDate>
		<dc:creator>Edu</dc:creator>
				<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Spring]]></category>

		<guid isPermaLink="false">http://www.sourcerebels.com/blog/?p=224</guid>
		<description><![CDATA[Simply a code I wrote today at my Spring Training / Simplemente un código que escribí hoy en el curso de Spring. applicationContext.xml: 1 2 3 4 5 6 7 8 9 10 &#60;?xml version=&#34;1.0&#34; encoding=&#34;UTF-8&#34; ?&#62; &#60;beans xmlns=&#34;http://www.springframework.org/schema/beans&#34; xmlns:xsi=&#34;http://www.w3.org/2001/XMLSchema-instance&#34; xsi:schemaLocation=&#34; http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd&#34;&#62; &#160; &#60;bean id=&#34;postProcessor&#34; class=&#34;com.sourcerebels.test.postprocessor.PostProcessor&#34;/&#62; &#60;bean id=&#34;someBusinessRule&#34; class=&#34;com.sourcerebels.test.postprocessor.SomeBusinessRule&#34; lazy-init=&#34;true&#34;&#62; &#60;property name=&#34;message&#34; value=&#34;someBusinessRule executed&#34;/&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>Simply a code I wrote today at my Spring Training / Simplemente un código que escribí hoy en el curso de Spring.</p>
<p>applicationContext.xml:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <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>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;beans</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://www.springframework.org/schema/beans&quot;</span></span>
<span style="color: #009900;">       <span style="color: #000066;">xmlns:xsi</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</span></span>
<span style="color: #009900;">       <span style="color: #000066;">xsi:schemaLocation</span>=<span style="color: #ff0000;">&quot; http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd&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;bean</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;postProcessor&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;com.sourcerebels.test.postprocessor.PostProcessor&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bean</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;someBusinessRule&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;com.sourcerebels.test.postprocessor.SomeBusinessRule&quot;</span> <span style="color: #000066;">lazy-init</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
               <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;message&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;someBusinessRule executed&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bean<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/beans<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>Advice:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">com.sourcerebels.test.postprocessor</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.lang.reflect.Method</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.springframework.aop.AfterReturningAdvice</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.springframework.aop.MethodBeforeAdvice</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> TransactionAdvice <span style="color: #000000; font-weight: bold;">implements</span> MethodBeforeAdvice, AfterReturningAdvice <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> before<span style="color: #009900;">&#40;</span><span style="color: #003399;">Method</span> method, <span style="color: #003399;">Object</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args, <span style="color: #003399;">Object</span> target<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">Throwable</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Starting Transaction&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> afterReturning<span style="color: #009900;">&#40;</span><span style="color: #003399;">Object</span> returnValue, <span style="color: #003399;">Method</span> method, <span style="color: #003399;">Object</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args, <span style="color: #003399;">Object</span> target<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">Throwable</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Commit Transaction&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>BusinessRule interface:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">com.sourcerebels.test.postprocessor</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">interface</span> BusinessRule <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #000066; font-weight: bold;">void</span> run<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>SomeBusinessRule class:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">com.sourcerebels.test.postprocessor</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> SomeBusinessRule <span style="color: #000000; font-weight: bold;">implements</span> BusinessRule <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">String</span> message<span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> run<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>message<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <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>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setMessage<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> message<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;">message</span> <span style="color: #339933;">=</span> message<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Postprocessor:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">com.sourcerebels.test.postprocessor</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.springframework.aop.framework.ProxyFactory</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.springframework.beans.BeansException</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.springframework.beans.factory.config.BeanPostProcessor</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #008000; font-style: italic; font-weight: bold;">/**
 * @author edu@sourcerebels.com
 */</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> PostProcessor <span style="color: #000000; font-weight: bold;">implements</span> BeanPostProcessor <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">Object</span> postProcessBeforeInitialization<span style="color: #009900;">&#40;</span><span style="color: #003399;">Object</span> bean, <span style="color: #003399;">String</span> beanName<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> BeansException <span style="color: #009900;">&#123;</span>
        <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;postProcessBeforeInitialization&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">return</span> bean<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">Object</span> postProcessAfterInitialization<span style="color: #009900;">&#40;</span><span style="color: #003399;">Object</span> bean, <span style="color: #003399;">String</span> beanName<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> BeansException <span style="color: #009900;">&#123;</span>
        <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;postProcessAfterInitialization&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>bean <span style="color: #000000; font-weight: bold;">instanceof</span> BusinessRule<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;building proxy object&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            ProxyFactory proxyFactory <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ProxyFactory<span style="color: #009900;">&#40;</span>bean<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            proxyFactory.<span style="color: #006633;">addInterface</span><span style="color: #009900;">&#40;</span>BusinessRule.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            proxyFactory.<span style="color: #006633;">addAdvice</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> TransactionAdvice<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000000; font-weight: bold;">return</span> proxyFactory.<span style="color: #006633;">getProxy</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000000; font-weight: bold;">return</span> bean<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Main:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">com.sourcerebels.test.postprocessor</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.springframework.context.ApplicationContext</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.springframework.context.support.ClassPathXmlApplicationContext</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Main <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
        <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> paths <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">&quot;com/sourcerebels/test/postprocessor/applicationContext.xml&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
        ApplicationContext ctx <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ClassPathXmlApplicationContext<span style="color: #009900;">&#40;</span>paths<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        BusinessRule negocio <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>BusinessRule<span style="color: #009900;">&#41;</span> ctx.<span style="color: #006633;">getBean</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;someBusinessRule&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        negocio.<span style="color: #006633;">run</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        negocio <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>BusinessRule<span style="color: #009900;">&#41;</span> ctx.<span style="color: #006633;">getBean</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;someOtherBusinessRule&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        negocio.<span style="color: #006633;">run</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.sourcerebels.com/blog/simple-spring-proxy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache Maven. Compiler JVM Compliance level / Compilador Nivel de especificación JVM</title>
		<link>http://www.sourcerebels.com/blog/apache-maven-compiler-jvm-compliance-level-compilador-nivel-de-especificacion-jvm/</link>
		<comments>http://www.sourcerebels.com/blog/apache-maven-compiler-jvm-compliance-level-compilador-nivel-de-especificacion-jvm/#comments</comments>
		<pubDate>Sun, 22 Nov 2009 12:31:55 +0000</pubDate>
		<dc:creator>Edu</dc:creator>
				<category><![CDATA[Compiler]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Maven]]></category>

		<guid isPermaLink="false">http://www.sourcerebels.com/blog/?p=213</guid>
		<description><![CDATA[At your pom.xml / En tu fichero pom.xml: &#60;plugin&#62; &#60;groupId&#62;org.apache.maven.plugins&#60;/groupId&#62; &#60;artifactId&#62;maven-compiler-plugin&#60;/artifactId&#62; &#60;configuration&#62; &#60;source&#62;1.6&#60;/source&#62; &#60;target&#62;1.6&#60;/target&#62; &#60;/configuration&#62; &#60;/plugin&#62;]]></description>
			<content:encoded><![CDATA[<p>At your pom.xml / En tu fichero pom.xml:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;plugin<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>org.apache.maven.plugins<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>maven-compiler-plugin<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;configuration<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;source<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>1.6<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/source<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>1.6<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/configuration<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/plugin<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.sourcerebels.com/blog/apache-maven-compiler-jvm-compliance-level-compilador-nivel-de-especificacion-jvm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UrlRewriteFilter. Setting up / Configuración</title>
		<link>http://www.sourcerebels.com/blog/urlrewritefilter-setting-up-configuracion/</link>
		<comments>http://www.sourcerebels.com/blog/urlrewritefilter-setting-up-configuracion/#comments</comments>
		<pubDate>Sat, 21 Nov 2009 11:09:54 +0000</pubDate>
		<dc:creator>Edu</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Maven]]></category>
		<category><![CDATA[UrlRewriteFilter]]></category>

		<guid isPermaLink="false">http://www.sourcerebels.com/blog/?p=209</guid>
		<description><![CDATA[Add this Maven dependency to your pom.xml or download urlrewrite*.jar from UrlRewriteFilter Home / Añade esta dependencia Maven a tu pom.xml o descarga urlrewrite*.jar desde la home de UrlRewriteFilter. &#60;dependency&#62; &#60;groupId&#62;org.tuckey&#60;/groupId&#62; &#60;artifactId&#62;urlrewritefilter&#60;/artifactId&#62; &#60;version&#62;3.1.0&#60;/version&#62; &#60;/dependency&#62; Add this filter definition to your web.xml file / Añade esta definición de filtro a tu fichero web.xml: &#60;filter&#62; &#60;filter-name&#62;UrlRewriteFilter&#60;/filter-name&#62; &#60;filter-class&#62;org.tuckey.web.filters.urlrewrite.UrlRewriteFilter&#60;/filter-class&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>Add this Maven dependency to your pom.xml or download urlrewrite*.jar from UrlRewriteFilter Home / Añade esta dependencia Maven a tu pom.xml o descarga urlrewrite*.jar desde la home de UrlRewriteFilter.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>org.tuckey<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>urlrewritefilter<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>3.1.0<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Add this filter definition to your web.xml file / Añade esta definición de filtro a tu fichero web.xml:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>UrlRewriteFilter<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter-mapping<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>UrlRewriteFilter<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;url-pattern<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/*<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/url-pattern<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter-mapping<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Add the file urlrewrite.xml to your WEB-INF directory / Añade el fichero urlrewrite.xml a tu directorio WEB-INF:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #00bbdd;">&lt;!DOCTYPE urlrewrite</span>
<span style="color: #00bbdd;">	PUBLIC &quot;-//tuckey.org//DTD UrlRewrite 3.0//EN&quot;</span>
<span style="color: #00bbdd;">	&quot;http://tuckey.org/res/dtds/urlrewrite3.0.dtd&quot;&gt;</span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;urlrewrite<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;rule<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;from<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>^/some/olddir/(.*)$<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/from<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;to</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;redirect&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>/very/newdir/$1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/to<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/rule<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;rule</span> <span style="color: #000066;">match-type</span>=<span style="color: #ff0000;">&quot;wildcard&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;from<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/blog/archive/**<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/from<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;to</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;redirect&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>/roller/history/$1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/to<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/rule<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/urlrewrite<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Some useful links / Algunos enlaces útiles:</p>
<p><a href="http://tuckey.org/urlrewrite/#download">UrlRewriteFilter Download</a><br />
<a href="http://tuckey.org/urlrewrite/manual/3.0/">UrlRewriteFilter Manual v3.0</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sourcerebels.com/blog/urlrewritefilter-setting-up-configuracion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spring MVC. File Upload / Subir ficheros al servidor.</title>
		<link>http://www.sourcerebels.com/blog/spring-mvc-file-upload-subir-ficheros-al-servidor/</link>
		<comments>http://www.sourcerebels.com/blog/spring-mvc-file-upload-subir-ficheros-al-servidor/#comments</comments>
		<pubDate>Sat, 21 Nov 2009 09:35:47 +0000</pubDate>
		<dc:creator>Edu</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[Spring MVC]]></category>

		<guid isPermaLink="false">http://www.sourcerebels.com/blog/?p=200</guid>
		<description><![CDATA[HTML code / Código HTML: &#60;form method=&#34;POST&#34; enctype=&#34;multipart/form-data&#34; action=&#34;./myControllerURL&#34;&#62; &#60;input type=&#34;file&#34; name=&#34;file&#34;/&#62; &#60;input type=&#34;submit&#34; name=&#34;submit&#34; value=&#34;File Upload - Subir fichero&#34;/&#62; &#60;/form&#62; Spring configuration / Configuración Spring: &#60;bean id=&#34;multipartResolver&#34; class=&#34;org.springframework.web.multipart.commons.CommonsMultipartResolver&#34;&#62; &#60;property name=&#34;maxUploadSize&#34; value=&#34;100000000&#34;/&#62; &#60;/bean&#62; Controller code / código del controlador: MultipartHttpServletRequest multipartRequest = &#40;MultipartHttpServletRequest&#41; request; &#160; MultipartFile file = multipartRequest.getFile&#40;&#34;file&#34;&#41;; &#160; InputStream inputStream = null; OutputStream [...]]]></description>
			<content:encoded><![CDATA[<p>HTML code / Código HTML:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><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;">enctype</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;multipart/form-data&quot;</span> <span style="color: #000066;">action</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;./myControllerURL&quot;</span>&gt;</span>
	<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;file&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;file&quot;</span><span style="color: #66cc66;">/</span>&gt;</span>
	<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;">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;File Upload - Subir fichero&quot;</span><span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">form</span>&gt;</span></pre></div></div>

<p>Spring configuration / Configuración Spring:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bean</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;multipartResolver&quot;</span></span>
<span style="color: #009900;">	<span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;org.springframework.web.multipart.commons.CommonsMultipartResolver&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;maxUploadSize&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;100000000&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bean<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Controller code / código del controlador:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">MultipartHttpServletRequest multipartRequest <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>MultipartHttpServletRequest<span style="color: #009900;">&#41;</span> request<span style="color: #339933;">;</span>
&nbsp;
MultipartFile file <span style="color: #339933;">=</span> multipartRequest.<span style="color: #006633;">getFile</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;file&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003399;">InputStream</span> inputStream <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
<span style="color: #003399;">OutputStream</span> outputStream <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
<span style="color: #003399;">File</span> tmpFile <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;file.getOriginalFileName(): &quot;</span>
		<span style="color: #339933;">+</span> file.<span style="color: #006633;">getOriginalFilename</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;size:&quot;</span> <span style="color: #339933;">+</span> file.<span style="color: #006633;">getSize</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>file.<span style="color: #006633;">getSize</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
		tmpFile <span style="color: #339933;">=</span> <span style="color: #003399;">File</span>.<span style="color: #006633;">createTempFile</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;document_&quot;</span>, <span style="color: #0000ff;">&quot;.tmp&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		inputStream <span style="color: #339933;">=</span> file.<span style="color: #006633;">getInputStream</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		outputStream <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">FileOutputStream</span><span style="color: #009900;">&#40;</span>tmpFile<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">int</span> readBytes <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">byte</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> buffer <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #000066; font-weight: bold;">byte</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">8192</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>readBytes <span style="color: #339933;">=</span> inputStream.<span style="color: #006633;">read</span><span style="color: #009900;">&#40;</span>buffer, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">8192</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			outputStream.<span style="color: #006633;">write</span><span style="color: #009900;">&#40;</span>buffer, <span style="color: #cc66cc;">0</span>, readBytes<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		outputStream.<span style="color: #006633;">close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		inputStream.<span style="color: #006633;">close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Saved file: &quot;</span> <span style="color: #339933;">+</span> tmpFile.<span style="color: #006633;">getAbsolutePath</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">IOException</span> ioe<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #666666; font-style: italic;">// TODO - Manage the exception.</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.sourcerebels.com/blog/spring-mvc-file-upload-subir-ficheros-al-servidor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Maven. Integración básica de XMLBeans</title>
		<link>http://www.sourcerebels.com/blog/maven-integracion-basica-de-xmlbeans/</link>
		<comments>http://www.sourcerebels.com/blog/maven-integracion-basica-de-xmlbeans/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 11:01:35 +0000</pubDate>
		<dc:creator>Edu</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Maven]]></category>
		<category><![CDATA[XML Schema]]></category>

		<guid isPermaLink="false">http://www.sourcerebels.com/blog/?p=179</guid>
		<description><![CDATA[Ruta dónde almacenar los ficheros .xsd: src/main/xsd Extracto del fichero pom.xml: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 &#60;plugin&#62; &#60;groupId&#62;org.codehaus.mojo&#60;/groupId&#62; &#60;artifactId&#62;xmlbeans-maven-plugin&#60;/artifactId&#62; &#60;version&#62;2.3.2&#60;/version&#62; &#60;executions&#62; &#60;execution&#62; &#60;id /&#62; &#60;phase&#62;generate-sources&#60;/phase&#62; &#60;goals&#62; &#60;goal&#62;xmlbeans&#60;/goal&#62; &#60;/goals&#62; &#60;/execution&#62; &#60;/executions&#62; &#60;configuration&#62; &#60;verbose&#62;true&#60;/verbose&#62; &#60;quiet&#62;false&#60;/quiet&#62; &#60;outputJar&#62;target/schema.jar&#60;/outputJar&#62; &#60;javaSource&#62;1.5&#60;/javaSource&#62; &#60;/configuration&#62; &#60;/plugin&#62; Ruta de generación [...]]]></description>
			<content:encoded><![CDATA[<p>Ruta dónde almacenar los ficheros .xsd:</p>
<blockquote><p>src/main/xsd</p></blockquote>
<p>Extracto del fichero pom.xml:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;plugin<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>org.codehaus.mojo<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>xmlbeans-maven-plugin<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2.3.2<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;executions<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;execution<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;id</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;phase<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>generate-sources<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/phase<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;goals<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;goal<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>xmlbeans<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/goal<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/goals<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/execution<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/executions<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;configuration<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;verbose<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/verbose<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;quiet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>false<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/quiet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;outputJar<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>target/schema.jar<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/outputJar<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;javaSource<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>1.5<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/javaSource<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/configuration<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/plugin<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>Ruta de generación de ficheros .java:</p>
<blockquote><p>target/generated-sources</p></blockquote>
<p>Ruta de generación de ficheros .class:</p>
<blockquote><p>target/generated-classes</p></blockquote>
<p>JAR generado:</p>
<blockquote><p>target/schema.jar</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.sourcerebels.com/blog/maven-integracion-basica-de-xmlbeans/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eclipse Maven. m2eclipse Integración con WTP</title>
		<link>http://www.sourcerebels.com/blog/eclipse-maven-m2eclipse-integracion-con-wtp/</link>
		<comments>http://www.sourcerebels.com/blog/eclipse-maven-m2eclipse-integracion-con-wtp/#comments</comments>
		<pubDate>Sat, 14 Nov 2009 10:55:21 +0000</pubDate>
		<dc:creator>Edu</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Maven]]></category>

		<guid isPermaLink="false">http://www.sourcerebels.com/blog/?p=158</guid>
		<description><![CDATA[Actualización: Para descargar la integración con WTP, actualmente se debe hacer desde el update site: http://m2eclipse.sonatype.org/sites/m2e-extras Añadir el &#8220;update site&#8221; del plugin m2eclipse. http://m2eclipse.sonatype.org/update/ Instalar los componentes  dentro del grupo &#8220;Maven Integration&#8221; y el componente &#8220;Maven Integration for WTP&#8221;. Una vez instalados los componentes, reiniciar Eclipse. Crearemos un nuevo proyecto Maven pulsando control+N y seleccionando [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Actualización:</strong></p>
<p>Para descargar la integración con WTP, actualmente se debe hacer  desde el update site:</p>
<p><a href="http://m2eclipse.sonatype.org/sites/m2e-extras" target="_blank">http://m2eclipse.sonatype.org/sites/m2e-extras</a></p>
<ul>
<li>Añadir el &#8220;update site&#8221; del plugin m2eclipse.</li>
</ul>
<blockquote><p>http://m2eclipse.sonatype.org/update/</p></blockquote>
<ul>
<li>Instalar los componentes  dentro del grupo &#8220;Maven Integration&#8221; y el componente &#8220;Maven Integration for WTP&#8221;.</li>
</ul>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-159" title="eclipse_m2eclipse_software_update" src="http://www.sourcerebels.com/blog/wp-content/uploads/2009/11/eclipse_m2eclipse_software_update.png" alt="eclipse_m2eclipse_software_update" width="456" height="361" /></p>
<ul>
<li>Una vez instalados los componentes, reiniciar Eclipse.</li>
<li>Crearemos un nuevo proyecto Maven pulsando control+N y seleccionando &#8220;Maven Project&#8221; de la categoría de proyectos &#8220;Maven&#8221;.</li>
</ul>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-166" title="eclipse_m2eclipse_new_maven_project" src="http://www.sourcerebels.com/blog/wp-content/uploads/2009/11/eclipse_m2eclipse_new_maven_project.png" alt="eclipse_m2eclipse_new_maven_project" width="420" height="308" /></p>
<ul>
<li>En la primera pantalla del asistente dejaremos todas las opciones por defecto para crear un proyecto a partir de un arquetipo.</li>
<li>Escogeremos el arquetipo &#8220;maven-archetype-webapp&#8221; y pulsaremos &#8220;Next&#8221;.</li>
</ul>
<p style="text-align: left;"><img class="aligncenter size-full wp-image-169" title="eclipse_m2eclipse_maven_archetype_selection" src="http://www.sourcerebels.com/blog/wp-content/uploads/2009/11/eclipse_m2eclipse_maven_archetype_selection.png" alt="eclipse_m2eclipse_maven_archetype_selection" width="529" height="407" /></p>
<ul>
<li>Seleccionaremos los valores de las propiedades GroupId (Agrupación), ArtifactId (Identificador del artefacto), Version y Package.</li>
</ul>
<ul>
<li><img class="aligncenter size-full wp-image-173" title="eclipse_m2eclipse_maven_project_properties" src="http://www.sourcerebels.com/blog/wp-content/uploads/2009/11/eclipse_m2eclipse_maven_project_properties.png" alt="eclipse_m2eclipse_maven_project_properties" width="529" height="407" /></li>
</ul>
<ul>
<li>Desde este momento ya es posible añadir el proyecto a alguno de los servidores configurados en WTP y lo que es mejor utilizar el depurador en caso de que lo necesitemos.</li>
</ul>
<p><img class="aligncenter size-full wp-image-175" title="eclipse_m2eclipse_add_and_remove_projects" src="http://www.sourcerebels.com/blog/wp-content/uploads/2009/11/eclipse_m2eclipse_add_and_remove_projects.png" alt="eclipse_m2eclipse_add_and_remove_projects" width="420" height="393" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sourcerebels.com/blog/eclipse-maven-m2eclipse-integracion-con-wtp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eclipse Básico. Ejecutar Eclipse sobre JDK</title>
		<link>http://www.sourcerebels.com/blog/eclipse-basico-ejecutar-eclipse-sobre-jdk/</link>
		<comments>http://www.sourcerebels.com/blog/eclipse-basico-ejecutar-eclipse-sobre-jdk/#comments</comments>
		<pubDate>Sat, 14 Nov 2009 09:58:29 +0000</pubDate>
		<dc:creator>Edu</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.sourcerebels.com/blog/?p=146</guid>
		<description><![CDATA[Algunos plugin de Eclipse, como por ejemplo m2eclipse requieren que la plataforma Eclipse se ejecute sobre un JDK y no un JRE. Primero de todo para comprobar si nuestra instalación se ejecuta sobre un JRE. Seleccionar la opción &#8220;About Eclipse&#8221; del menú &#8220;Help&#8221;. Pulsar el botón &#8220;Installation Details&#8221;. Seleccionar la pestaña &#8220;Configuration&#8221;. En ese momento [...]]]></description>
			<content:encoded><![CDATA[<p>Algunos plugin de Eclipse, como por ejemplo <a title="m2eclipse" href="http://m2eclipse.sonatype.org/">m2eclipse</a> requieren que la plataforma Eclipse se ejecute sobre un JDK y no un JRE.</p>
<p>Primero de todo para comprobar si nuestra instalación se ejecuta sobre un JRE.</p>
<ol>
<li>Seleccionar la opción &#8220;About Eclipse&#8221; del menú &#8220;Help&#8221;.</li>
<li>Pulsar el botón &#8220;Installation Details&#8221;.</li>
<li>Seleccionar la pestaña &#8220;Configuration&#8221;.</li>
<li>En ese momento se nos mostrará un listado de propiedades de configuración de Eclipse. Localizar el valor de la propiedad &#8220;-vm&#8221; para determinar si la instalación se ejecuta sobre un JRE</li>
</ol>
<p>En mi caso, he detectado que la instalación se ejecuta sobre un JRE porque el valor de la propiedad &#8220;-vm&#8221; es el siguiente:</p>
<blockquote><p>-vm<br />
C:\development\Java\jre1.6.0_17\bin\client\jvm.dll</p></blockquote>
<p>En segundo lugar tendremos que modificar la configuración de Eclipse.</p>
<ol>
<li>Detener la ejecución de Eclipse.</li>
<li>Localizar y editar el fichero eclipse.ini de la ruta de instalación de Eclipse.</li>
<li>Añadir o editar la propiedad &#8220;-vm&#8221; para que esta apunte al ejecutable &#8220;java&#8221; o &#8220;javaw&#8221; si estamos en el sistema operativo de Microsoft.</li>
</ol>
<p>En mi caso, y sobre la instalación por defecto en Windows he añadido las dos siguientes líneas al inicio del fichero eclipse.ini:</p>
<blockquote><p>-vm<br />
C:\development\Java\jdk1.6.0_17\bin\javaw.exe</p></blockquote>
<p>En tercer lugar comprobaremos que realmente se han aplicado los cambios.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-147" title="eclipse_configuracion_jdk" src="http://www.sourcerebels.com/blog/wp-content/uploads/2009/11/eclipse_configuracion_jdk.png" alt="eclipse_configuracion_jdk" width="414" height="458" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sourcerebels.com/blog/eclipse-basico-ejecutar-eclipse-sobre-jdk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WTF! Apple</title>
		<link>http://www.sourcerebels.com/blog/wtf-apple/</link>
		<comments>http://www.sourcerebels.com/blog/wtf-apple/#comments</comments>
		<pubDate>Sat, 10 Oct 2009 10:46:00 +0000</pubDate>
		<dc:creator>Edu</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[WTF]]></category>

		<guid isPermaLink="false">http://www.sourcerebels.com/blog/?p=136</guid>
		<description><![CDATA[La imagen habla por si misma.]]></description>
			<content:encoded><![CDATA[<p>La imagen habla por si misma.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-137" title="wtf_memoria_apple" src="http://www.sourcerebels.com/blog/wp-content/uploads/2009/10/wtf_memoria_apple.PNG" alt="wtf_memoria_apple" width="447" height="91" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sourcerebels.com/blog/wtf-apple/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Debian/Java. Parte IV: Instalando y configurando MySQL</title>
		<link>http://www.sourcerebels.com/blog/debianjava-parte-iv-instalando-y-configurando-mysql/</link>
		<comments>http://www.sourcerebels.com/blog/debianjava-parte-iv-instalando-y-configurando-mysql/#comments</comments>
		<pubDate>Sun, 25 Jan 2009 17:31:39 +0000</pubDate>
		<dc:creator>Edu</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[GNU]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://www.sourcerebels.com/blog/?p=83</guid>
		<description><![CDATA[Instalación de MySQL server. su -c apt-get install mysql-server-5.0 Lo primero que debemos hacer es configurarle una contraseña al usuario root. Esto lo haremos con el comando mysqladmin, que viene incluido en la distribucion de MySQL. mysqladmin -h localhost -u root password contraseña_nueva_de_root Como de costumbre, instalaremos las utilidades gráficas. Instalación de MySQL Administrator. su [...]]]></description>
			<content:encoded><![CDATA[<p>Instalación de MySQL server.</p>
<blockquote><p>su -c apt-get install mysql-server-5.0</p></blockquote>
<p>Lo primero que debemos hacer es configurarle una contraseña al usuario <em>root</em>. Esto lo haremos con el comando mysqladmin, que viene incluido en la distribucion de MySQL.</p>
<blockquote><p>mysqladmin -h localhost -u root password <em>contraseña_nueva_de_root</em></p></blockquote>
<p>Como de costumbre, instalaremos las utilidades gráficas.</p>
<p>Instalación de MySQL Administrator.</p>
<blockquote><p>su -c &#8216;apt-get install mysql-admin&#8217;</p></blockquote>
<p>MySQL Administrator es una interfaz gráfica para administrar diferentes aspectos de la base de datos MySQL, como por ejemplo la seguridad o las cuentas de usuario.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-98" title="debian_java_parteiv_mysql_administrator" src="http://www.sourcerebels.com/blog/wp-content/uploads/2009/01/debian_java_parteiv_mysql_administrator.png" alt="debian_java_parteiv_mysql_administrator" width="524" height="349" /></p>
<p style="text-align: center;">Primera ejecución de MySQL Administrator</p>
<p style="text-align: left;"><strong>Creación de un nuevo esquema de base de datos:</strong> A continuación definiremos un nuevo esquema o base de datos llamado <em>test</em>, sobre el que ejecutaremos algunas pruebas más adelante. Para ello, haremos <em>click</em> en la opción <em>Catalogs</em> del menú de la izquierda. Veremos que en la parte inferior izquierda nos aparece un apartado con los diferentes esquemas de base de datos que hay creados (normalmente <em>information_schema</em> y <em>mysql</em> para una instalación &#8220;limpia&#8221;), haremos <em>click</em> en una zona libre de ese apartado con el botón derecho y seleccionaremos la opción <em>Create schema </em>tal y como se puede ver en la siguiente captura.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-101" title="debian_java_parteiv_mysql_administrator_create_schema" src="http://www.sourcerebels.com/blog/wp-content/uploads/2009/01/debian_java_parteiv_mysql_administrator_create_schema.png" alt="debian_java_parteiv_mysql_administrator_create_schema" width="524" height="349" /></p>
<p style="text-align: left;">A continuación, se nos solicitará el nombre del nuevo esquema, en nuestro ejemplo hemos asignado el nombre <em>test</em>, ya que este esquema lo utilizaremos más adelante en diferentes pruebas.</p>
<p style="text-align: left;"><strong>Definición de un nuevo usuario con permisos sobre el nuevo esquema creado: </strong>Seleccionamos la opción <em>New User</em> del menú, tal y como se ve en la imagen.</p>
<p style="text-align: center;"><strong><img class="aligncenter size-full wp-image-108" title="debian_java_parteiv_mysql_administrator_user1" src="http://www.sourcerebels.com/blog/wp-content/uploads/2009/01/debian_java_parteiv_mysql_administrator_user1.png" alt="debian_java_parteiv_mysql_administrator_user1" width="533" height="369" /></strong></p>
<p style="text-align: left;">A continuación introduciremos el nombre de usuario y la contraseña, y haremos <em>click</em> en el botón <em>Apply Changes</em> en la parte inferior derecha.</p>
<p style="text-align: center;"><strong><img class="aligncenter size-full wp-image-110" title="debian_java_parteiv_mysql_administrator_user21" src="http://www.sourcerebels.com/blog/wp-content/uploads/2009/01/debian_java_parteiv_mysql_administrator_user21.png" alt="debian_java_parteiv_mysql_administrator_user21" width="534" height="369" /></strong></p>
<p style="text-align: left;">En la pestaña <em>Schema Privileges</em> seleccionaremos el esquema <em>test</em> del panel de la izquierda y a continuación seleccionaremos todos los permisos del panel de la derecha y haremos <em>click </em>en el botón <em>flecha izquierda </em>para asignar todos los privilegios seleccionados al usuario test. Con esto lo que haremos será darle acceso desde cualquier <em>host</em> de la red.</p>
<p style="text-align: center;"><strong><img class="aligncenter size-full wp-image-111" title="debian_java_parteiv_mysql_administrator_user3" src="http://www.sourcerebels.com/blog/wp-content/uploads/2009/01/debian_java_parteiv_mysql_administrator_user3.png" alt="debian_java_parteiv_mysql_administrator_user3" width="533" height="369" /></strong></p>
<p style="text-align: left;">El siguiente paso sería probar el usuario pero eso lo haremos más adelante con el programa MySQL Query Browser.</p>
<p>Instalación de MySQL Query Browser</p>
<blockquote><p>su -c &#8216;apt-get install mysql-query-browser&#8217;</p></blockquote>
<p style="text-align: left;">MySQL Query Browser es una interfaz gráfica para ejecutar sentencias o scripts SQL.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-91" title="debian_java_parteiv_mysql_query_browser" src="http://www.sourcerebels.com/blog/wp-content/uploads/2009/01/debian_java_parteiv_mysql_query_browser.png" alt="debian_java_parteiv_mysql_query_browser" width="486" height="379" /></p>
<p style="text-align: center;">Primera ejecución de MySQL Query Browser</p>
<p style="text-align: left;"><strong>Conexiones remotas a la base de datos MySQL:</strong> Suponiendo que queramos que alguna máquina de la red pueda conectar con nuestro servidor MySQL utilizando uno de los múltiples clientes que existen deberemos indicarlo a MySQL editando para ello el fichero de configuración /etc/mysql/my.cnf.</p>
<p style="text-align: left;">Localizaremos el apartado:</p>
<blockquote>
<p style="text-align: left;">[mysqld]</p>
</blockquote>
<p style="text-align: left;">Cambiaremos el valor del parámetro <em>bind-address</em> por la dirección IP pública de la máquina.</p>
<blockquote>
<p style="text-align: left;">bind-address = IP_de_tu_servidor</p>
</blockquote>
<p style="text-align: left;">Reiniciaremos el servidor MySQL</p>
<blockquote>
<p style="text-align: left;">su -c &#8216;/etc/init.d/mysql stop&#8217;</p>
<p style="text-align: left;">su -c &#8216;/etc/init.d/mysql start&#8217;</p>
</blockquote>
<p style="text-align: left;">Con esto ya tenemos la base de datos funcionando así como un esquema y un usuario para hacer pruebas más adelante.</p>
<p style="text-align: left;">
]]></content:encoded>
			<wfw:commentRss>http://www.sourcerebels.com/blog/debianjava-parte-iv-instalando-y-configurando-mysql/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Debian/Java. Parte III: Instalando algunas utilidades</title>
		<link>http://www.sourcerebels.com/blog/debianjava-parte-iii-instalando-algunas-utilidades/</link>
		<comments>http://www.sourcerebels.com/blog/debianjava-parte-iii-instalando-algunas-utilidades/#comments</comments>
		<pubDate>Sun, 25 Jan 2009 10:55:12 +0000</pubDate>
		<dc:creator>Edu</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[GNU]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://www.sourcerebels.com/blog/?p=40</guid>
		<description><![CDATA[La instalación de los siguientes paquetes se puede obviar o no en función de vuestros gustos como usuario Midnight Commander. Gestor de ficheros (Cónsola). su -c &#8216;apt-get install mc&#8217; Este programa para mi es indispensable. Se trata de un clon de Norton Commander (el cual ya utilizaba en la época DOS). No explico nada nuevo [...]]]></description>
			<content:encoded><![CDATA[<p>La instalación de los siguientes paquetes se puede obviar o no en función de vuestros gustos como usuario <img src='http://www.sourcerebels.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Midnight Commander. Gestor de ficheros (Cónsola).</p>
<blockquote><p>su -c &#8216;apt-get install mc&#8217;</p></blockquote>
<p>Este programa para mi es indispensable. Se trata de un clon de <a title="Definicion de Comandante Norton en la Wikipedia" href="http://es.wikipedia.org/wiki/Comandante_Norton" target="_blank">Norton Commander</a> (el cual ya utilizaba en la época DOS). No explico nada nuevo pero se trata de aumentar la productividad a la hora de trabajar con ficheros, esto se consigue con dos paneles para navegar por el sistema de ficheros, y una serie de <a title="Mignight Commander keyboard shortcuts" href="http://www.keyxl.com/aaae4b0/407/Midnight-Commander-keyboard-shortcuts.htm" target="_blank">atajos de teclado</a> para hacer las tareas más comunes (copiar, mover, crear directorios, trabajar con ficheros comprimidos, FTP, etc.).</p>
<p><strong>Truquillo MC:</strong> En la parte inferior verás una linea donde puedes introducir comandos si introduces un comando del tipo <em>&#8220;cd ftp://tu_usuario:tu_contraseña@tu_servidor_ftp&#8221;</em> abriras una sesión FTP. Es por ese motivo que en la siguiente lista de aplicaciones no incluido ningún cliente FTP.</p>
<p>Unzip. Utilidad para descomprimir ficheros en formato zip (Cónsola).</p>
<blockquote><p>su -c &#8216;apt-get install unzip&#8217;</p></blockquote>
<p>Vim. Vi Improved. Editor de textos generalista para términal vi con algunas mejoras (Cónsola).</p>
<blockquote><p>su -c &#8216;apt-get install vim&#8217;</p></blockquote>
<p>SciTE. Editor de textos generalista (Gui).</p>
<blockquote><p>su -c &#8216;apt-get install scite&#8217;</p></blockquote>
<p>Dillo. Navegador web &#8220;ligero&#8221; (Gui).</p>
<blockquote><p>su -c &#8216;apt-get install dillo&#8217;</p></blockquote>
<p>Iceweasel. Navegador web &#8220;completo&#8221; (Gui).</p>
<blockquote><p>su -c &#8216;apt-get install iceweasel&#8217;</p></blockquote>
<p>Wget. Gestor de descargas (Cónsola).</p>
<blockquote><p>su -c &#8216;apt-get install wget&#8217;</p></blockquote>
<p>Estas son las utilidades que yo instalo siempre pero como dijo Groucho Marx <em>&#8220;Estos son mis principios. Si no le gustan tengo otros&#8221;</em>. Aquí pongo una captura del rollete de hoy <img src='http://www.sourcerebels.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-67" title="debian_java_parteiii_iceweasel_scite" src="http://www.sourcerebels.com/blog/wp-content/uploads/2009/01/debian_java_parteiii_iceweasel_scite.png" alt="debian_java_parteiii_iceweasel_scite" width="615" height="461" /></p>
<p style="text-align: center;">Navegador web Iceweasel y editor de texto SciTE</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sourcerebels.com/blog/debianjava-parte-iii-instalando-algunas-utilidades/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Debian/Java. Parte II: X-Window</title>
		<link>http://www.sourcerebels.com/blog/debianjava-parte-ii-x-window/</link>
		<comments>http://www.sourcerebels.com/blog/debianjava-parte-ii-x-window/#comments</comments>
		<pubDate>Sat, 24 Jan 2009 07:42:20 +0000</pubDate>
		<dc:creator>Edu</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[GNU]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://www.sourcerebels.com/blog/?p=26</guid>
		<description><![CDATA[Como comenté en el post anterior, en esta parte instalaremos el sistema gráfico X-Window y el gestor de ventanas XFCE sobre Debian GNU/Linux. Todo estos paquetes más básicos los instalaremos vía gestor de paquetes apt-get. Para ello lo primero será actualizar las listas de paquetes que este gestor tiene configuradas. Esto se hace con un [...]]]></description>
			<content:encoded><![CDATA[<p>Como comenté en el post anterior, en esta parte instalaremos el sistema gráfico <a title="Definición de X-Window en la Wikipedia" href="http://es.wikipedia.org/wiki/Sistema_X_Window" target="_blank">X-Window</a> y el gestor de ventanas <a title="Definición de Xfce en la Wikipedia" href="http://es.wikipedia.org/wiki/Xfce" target="_blank">XFCE</a> sobre Debian GNU/Linux. Todo estos paquetes más básicos los instalaremos vía gestor de paquetes apt-get. Para ello lo primero será actualizar las listas de paquetes que este gestor tiene configuradas. Esto se hace con un sencillo comando.</p>
<blockquote><p>su -c &#8216;apt-get update&#8217;</p></blockquote>
<p>A continuación instalaremos el paquete xserver-xorg.</p>
<blockquote><p>su -c &#8216;apt-get install xserver-xorg&#8217;</p></blockquote>
<p><strong>Interesante:</strong> apt-get descargará e instalará automáticamente todas las dependencias del paquete xserver-xorg.</p>
<p>Una vez instalado el paquete, se ejecutará automáticamente el asistente de configuración. Este nos preguntará por la resolución que queremos utilizar en nuestro sistema.</p>
<p><img class="aligncenter size-full wp-image-30" title="debian_java_parte_ii_instalacion_xserver" src="http://www.sourcerebels.com/blog/wp-content/uploads/2009/01/debian_java_parte_ii_instalacion_xserver.png" alt="debian_java_parte_ii_instalacion_xserver" width="721" height="401" /></p>
<p>Una vez instalado el servidor X-Window ya deberíamos ser capaces de iniciar una sesión gráfica aunque, antes de esto, instalaremos un gestor de ventanas para hacer más amigable el uso de nuestro sistema. Un gestor de ventanas no es otra cosa que la aplicación que indica al servidor gráfico X-Window como se va a comportar este (por ejemplo: como será el aspecto de las ventanas, como se comportará el sistema cuando hagamos alguna acción con el ratón, etc.). Tal y como indicamos al principio, instalaremos el gestor de ventanas XFCE en su versión 4, por tratarse de un sistema ligero y con el que me siento bastante cómodo.</p>
<blockquote><p>su -c &#8216;apt-get install xfce4&#8242;</p></blockquote>
<p>Una vez este proceso acabe, por fin, seremos capaces de iniciar una sesión gráfica en el equipo.</p>
<blockquote><p>startx</p></blockquote>
<p>Para nuestra desilusión, el sistema no es capaz de iniciar la sesión gráfica. Nos muestra el siguiente mensaje de error:</p>
<blockquote><p>Fatal server error:</p>
<p>could not open default font &#8216;fixed&#8217;</p>
<p>&#8230;</p></blockquote>
<p>El mensaje de error es bastante explicativo, como hemos partido de una instalación mínima seguramente nos faltará instalar algún paquete adicional. Aparentemente las fuentes del sistema.</p>
<blockquote><p>su -c &#8216;apt-get install xfonts-base&#8217;</p></blockquote>
<p>Ahora sí que por fin podremos iniciar la sesión gráfica.</p>
<blockquote><p>startx</p></blockquote>
<p>La siguiente captura muestra el gestor de ventanas Xfce4 corriendo sobre nuestro Debian:</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-33" title="debian_java_parteii_xfce4" src="http://www.sourcerebels.com/blog/wp-content/uploads/2009/01/debian_java_parteii_xfce4.png" alt="debian_java_parteii_xfce4" width="614" height="460" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sourcerebels.com/blog/debianjava-parte-ii-x-window/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Debian/Java. Parte I: Personalización del entorno</title>
		<link>http://www.sourcerebels.com/blog/debianjava-parte-i-personalizacion-del-entorno/</link>
		<comments>http://www.sourcerebels.com/blog/debianjava-parte-i-personalizacion-del-entorno/#comments</comments>
		<pubDate>Thu, 22 Jan 2009 22:45:34 +0000</pubDate>
		<dc:creator>Edu</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[GNU]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://www.sourcerebels.com/blog/?p=3</guid>
		<description><![CDATA[En primer lugar y partiendo de una instalación mínima de Debian GNU/Linux. Esta se ha hecho partiendo de la imagen mini.iso e instalando únicamente el conjunto de paquetes software base. Como no es recomendable el uso del usuario root para el uso ordinario del equipo, lo primero que haremos será definir un nuevo usuario: useradd [...]]]></description>
			<content:encoded><![CDATA[<p>En primer lugar y partiendo de una instalación mínima de <a title="Debian.org" href="http%3A%2F%2Fwww.debian.org%2Findex.es.htm" target="_blank">Debian GNU/Linux</a>. Esta se ha hecho partiendo de la imagen <a title="Imagen mini.iso netinstall Debian GNU/Linux" href="http://www.debian.org/distrib/netinst#netboot" target="_blank">mini.iso</a> e instalando únicamente el conjunto de paquetes software base. Como no es recomendable el uso del usuario <a title="Definición de root en la Wikipedia" href="http://es.wikipedia.org/wiki/Root" target="_blank"><em>root</em></a> para el uso ordinario del equipo, lo primero que haremos será definir un nuevo usuario:</p>
<blockquote><p>useradd -d /home/sourcerebel -s /bin/bash -m sourcerebel</p></blockquote>
<p>Por defecto, un usuario de unix dispone de un espacio donde instalar sus aplicaciones o simplemente guardar su información, este espacio se conoce como su <em>hogar</em> o, en inglés, <em>home</em>. El parámetro <em>-d</em> indica al comando <em>adduser</em> cual va a ser el directorio <em>home</em> del usuario. El parámetro <em>-m</em> indica al comando <em>adduser</em> que debe crear este directorio.</p>
<p><strong>Bonito de recordar:</strong> La variable de entorno $HOME contiene la ruta absoluta al directorio <em>home</em> del usuario actual y que utilizando la orden <em>cd</em> (change directory) sin parámetro alguno, este nos situará en nuestro <em>home</em>.</p>
<p><strong>Importantísimo:</strong> Se puede acceder a la ayuda en línea de cualquier comando tecleando la orden <em>man</em> seguida del comando. <a title="Unix / Linux command overview" href="http://www.computerhope.com/unix/overview.htm" target="_blank">Aquí</a> podeis encontrar uno de los cientos de listados de comandos disponibles en Internet.</p>
<p>Así mismo, a no ser de que estemos definiendo un usuario de sistema (ver el uso del parámetro <em>&#8211;system</em> de la orden <em>adduser</em>), el usuario creado podrá abrir una sesión e introducir órdenes para que el ordenador las ejecute. Esto se hace a través de un intérprete de comandos o shell. Esta definición queda un poco triste por lo que mejor <a title="Definición de shell en Wikipedia" href="http://es.wikipedia.org/wiki/L%C3%ADnea_de_comandos" target="_blank">leer esta</a>.</p>
<p>En Unix tradicionalmente existen diferentes intérpretes de comandos aunque jamás conocí a un usuario de Unix/Linux que no utilizase algo que no fuese bash.</p>
<p>Definir el <a title="Definición de bash en la Wikipedia" href="http://es.wikipedia.org/wiki/Bash" target="_blank">shell</a> por defecto del usuario que estamos creando es lo que indica el parámetro <em>-s</em>.</p>
<p>Añadimos un password para el nuevo usuario creado:</p>
<blockquote><p>passwd sourcerebel</p></blockquote>
<p>A partir de este momento, utilizaremos este nuevo usuario para ejecutar todas las instrucciones necesarias para la instalación. En caso que fuese indispensable el uso del usuario root, sería indicado.</p>
<p>Bien, en este punto, estamos delante de una pantalla tipo terminal con la, no despreciable, resolución de 80 columnas x 40 líneas, es un buen momento para detenerse, respirar hondo y pensar</p>
<p><em>&#8220;¿qué es lo que acabo de hacer?&#8221;</em></p>
<p>Bueno, que el entorno es austero es un hecho, pero y &#8220;¿ahora que hago con el ratón?, ¿lo tiro a la basura?&#8221;. Vamos a hacer más amigable esto dando la posibilidad de utilizar el ratón en este modo, parece un poco raro pero se puede utilizar el ratón en modo texto, es un hecho, conozco a una persona que tiene un amigo que lo vió.</p>
<p><a title="Definición de GPM en la Wikipedia (Inglés)" href="http://en.wikipedia.org/wiki/GPM_(software)" target="_blank">GPM</a> o General Purpose Mouse, nombre original donde los haya, es un servicio o <a title="Definición de demonio en la Wikipedia" href="http://es.wikipedia.org/wiki/Demonio_(inform%C3%A1tica)" target="_blank"><em>demonio</em></a> que se encarga de hacer funcionar el ratón en modo texto, que no es una funcionalidad que vayamos a utilizar mucho pero que en algún momento nos puede resultar útil para por ejemplo poder copiar y pegar texto en caso de no tener abierta una sesión gráfica.</p>
<p>Para instalar GPM se debe ejecutar el siguiente comando como usuario <em>root</em>.</p>
<blockquote><p>su &#8211; c &#8216;apt-get install gpm&#8217;</p></blockquote>
<p>Con la orden su -c, lo que indicamos al sistema es que queremos ejecutar ese comando como usuario <em>root.</em> Tal y como pensabas inmediatamente despues nos pedirá la contraseña del usuario <em>root</em>. <a title="apt-get-mini-COMO" href="http://www.debian.org/international/spanish/contrib/apt-get-mini-COMO.html" target="_blank">apt-get</a> es el gestor de paquetes que viene por defecto en Debian, y lo que estamos indicando con esta orden es que deseamos instalar el paquete gpm.</p>
<p><strong>Consejillo:</strong> Copiar y pegar en con el ratón en GNU/Linux es una tarea muy sencilla. Debes saber, no obstante y sobretodo si vienes de un entorno Microsoft, que el funcionamiento no será el esperado. Cuando marcas <em>algo</em> con el ratón, automáticamente este algo que has marcado pasa a estar copiado en el portapapeles o <em>clipboard</em>. Esto, que es muy sencillo de comprender y que tiene toda su lógica si lo piensas detenidamente, puede llegar a crear confusión al principio, aunque acabas cogiendole el gustillo. Para pegar, simplemente tienes que hacer click con el boton derecho.</p>
<p>Como trabajar con un entorno en modo texto puede resultar útil en algunos momentos pero la intención es ser un poquito más productivos y disponer de un entorno más amigable, en siguientes post veremos como instalar un interfaz gráfico.</p>
<p>Como despedida os dejo con una captura del sistema operativo Debian GNU/Linux recien instalado.</p>
<p><img class="aligncenter size-full wp-image-19" title="debian_java_parte_i" src="http://www.sourcerebels.com/blog/wp-content/uploads/2009/01/debian_java_parte_i.png" alt="debian_java_parte_i" width="722" height="401" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sourcerebels.com/blog/debianjava-parte-i-personalizacion-del-entorno/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
