<?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; Java</title>
	<atom:link href="http://www.sourcerebels.com/blog/category/java/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>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>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>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>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>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>
	</channel>
</rss>
