Mostrando entradas con la etiqueta java. Mostrar todas las entradas
Mostrando entradas con la etiqueta java. Mostrar todas las entradas
10 octubre 2014

#{ JAVA: Spring Integration Mail }

0 comentarios
Como configurar correctamente Spring Integration Mail y no morir en el intento.
http://blog.solidcraft.eu/2011/04/read-emails-from-imap-with-spring.html
23 septiembre 2014

#{ TIPS: Log4j prioridad y jerarquía }

0 comentarios
Prioridad y precedencia de log4j, por ej. si defino level "DEBUG" se incluyen todos desde "DEBUG" hasta "FATAL".
Sólo uno mayor desactiva hacia abajo en la jerarquía, por ej: "OFF" desactiva todos.
    public static final int OFF_INT = 2147483647;
    public static final int FATAL_INT = 50000;
    public static final int ERROR_INT = 40000;
    public static final int WARN_INT = 30000;
    public static final int INFO_INT = 20000;
    public static final int DEBUG_INT = 10000;
    public static final int ALL_INT = -2147483648;
08 agosto 2014

#{ TIP: Escribir tildes y caracteres especiales en java }

0 comentarios

\u00e1 -> á
\u00e9 -> é
\u00ed -> í
\u00f3 -> ó
\u00fa -> ú
\u00c1 -> Á
\u00c9 -> É
\u00cd -> Í
\u00d3 -> Ó
\u00da -> Ú
\u00f1 -> ñ
\u00d1 -> Ñ
07 febrero 2014

#{ TIP: Builder Pattern }

0 comentarios

Builder Pattern ejemplo, queda bonito llamar a los constructores así, además se bypassear, los valores por defecto de los métodos (default value parameter) como por ejemplo se puede hacer en otros lenguajes como C++ o ActionScript3 por ejemplo:
void parameterizedMethod(float param1, int param2, bool param3=false);
En JAVA se puede "bypassear" con la siguiente técnica:
public class StudentBuilder
{
    private String _name;
    private int _age = 14;      // this has a default
    private String _motto = ""; // most students don't have one

    public StudentBuilder() { }

    public Student buildStudent()
    {
        return new Student(_name, _age, _motto);
    }

    public StudentBuilder name(String _name)
    {
        this._name = _name;
        return this;
    }

    public StudentBuilder age(int _age)
    {
        this._age = _age;
        return this;
    }

    public StudentBuilder motto(String _motto)
    {
        this._motto = _motto;
        return this;
    }
}
Student s1 = new StudentBuilder().name("Eli").buildStudent();
Student s2 = new StudentBuilder()
                 .name("Spicoli")
                 .age(16)
                 .motto("Aloha, Mr Hand")
                 .buildStudent();
http://stackoverflow.com/questions/222214/managing-constructors-with-many-parameters-in-java-1-4/222295#222295
02 enero 2014

#{ TIP: Correr casi 'infinito' evitando stackoverflowerror }

0 comentarios

public static void foo() {
    try {
        foo();
    } finally {
        foo();
    }
}

public static void bar() {
    bar();
}

http://stackoverflow.com/questions/12438786/try-finally-block-prevents-stackoverflowerror
10 octubre 2013

#{ ARQ: Armando base para construir }

0 comentarios

Me encuentro armando una base con la siguiente arquitectura que me "gusta" y luego de leer, estoy convencido que es lo mejor:
  • Spring MVC
  • MyBatis
  • jQuery
Eso para partir, luego la idea es integrarle: Bootsrap, CXF, Security, Tiles, UrlRewriteFilter, entre otros.

Links:
  1. http://panyongzheng.iteye.com/blog/1811017
  2. http://www.technicalkeeda.com/bootstrap/twitter-bootstrap-with-spring-mvc
  3. https://github.com/hmkcode/Spring-Framework/blob/master/spring-mybatis/pom.xml
  4. https://github.com/priyatam/springmvc-twitterbootstrap-showcase
  5. http://hmkcode.com/mybatis-spring-junit-the-missing-part/
 
Buffer de Código | © Design by DheTemplate.com and Theme 2 Blog

Find more free Blogger templates at DheTemplate.com - Daily Updates Free Blogger Templates