====== Apuntes de Java ====== Varias notas sobre java. **Application servers** * [[Jboss|Jboss]] * [[Tomcat|Tomcat]] **Frameworks and Tools** * [[eclipse|Eclipse]] * [[NotasSobrePluginsEclipse|Mis notas sobre plugins eclipse]] * [[maven|Maven]] * [[jsf|JSF]] * [[jsp|JSP]] * [[JUnit4|Junit4]] * [[spring|Spring]] * [[hibernate|Hibernate]] * [[log4j|Example of configuration of log4j]] * [[log4j:notProcessSafe|Log4j is not process safe]] **Standards** * [[http://docs.oracle.com/javase/specs/#251530|ESTANDAR JAVA]] * [[http://wiki.metawerx.net/wiki/Web.xml]] - toda la documentación sobre "web.xml" * [[webxml|Web.xml]] * [[javadoc|Javadoc made easy]] * [[javaBeans|Java Beans]] * [[MimeTypes|MimeTypes]] **Recipes** * [[howToMakeALinkLookLikeAButton|How to make a link look like a button]] * [[http://java67.blogspot.com.es/2015/07/how-to-stop-thread-in-java-example.html|How to stop a thread]] * [[DevelopmentMode|Configurar modo desarrollo]] * [[NumerosAleatorios|Números Aleatorios]] * [[concurrentQueue|A concurrent version of a queue]] * [[writingErrorsInLog|Writing properly errors in log file]] * [[durationToText|Convert a time duration into a text]] * [[javaService|Create your own java windows services using the Jboss service wrapper]] * [[javaServiceLinux|A simple script for creating a service in linux]] * [[searchInsideAJarFile|How to search inside a Jar file]] * [[allAvailableTimeZones|List all available timezones that are in your JVM]] * [[CreateMd5HashInJavaWithSpring|Create a md5 hash in java with eclipse]] **Projects** * [[TestPi4J|TestPI4J: A testing framework for your PI4J Projects]] * [[MiningTheSocialWeb|Mining the Social Web]] * [[2by2RubikCube|The Rubik's cube 2 by 2]] **Miscellaneous** * [[Ayuda|Ayuda]] * [[JDBC|JDBC]] * [[ficheros|Ficheros]] * [[Infocenter|Setting up an Infocenter -or help system- for a project]] * [[java7onLinux|Install java 7 on linux by hand]] * [[http://www2.sys-con.com/ITSG/virtualcd/Java/archives/0612/mair/index.html|Xproperties]] * [[Minecraft|Minecraft]] * [[Sonar|Sonar]] ==== About software tools to synchronize with subversion ==== **2013/03/22 update:** I've tried subversion in a Windows machine and I found out that it doesn't work because it requires a connector and the instructions to download the connector are not easily found. I recognize that I gave up at first difficulty, but talking about plugins, I don't give them many opportunities. Moreover, I found that the //subclipse// plugin has more popularity. I have a 64 bit laptop --Intel--. I usually develop java in there. I found that the subclipse plugin for subversion crashes frequently, but the [[http://www.eclipse.org/subversive|Subversive]] doesn't. For anyone that may be interested. And by the way, if you are planning to download something from sourceforge, choose SVN Kit 1.3.2 connector compatible with version 1.6.x of subversion. See this: http://sourceforge.net/scm/?type=svn&group_id=80882. ==== Configure a C3P0 datasource in spring ==== http://forum.springsource.org/showthread.php?16309-How-to-config-c3p0-datasource-in-spring ==== Launching a java batch file from a visual basic script ==== ' ' sisyphus.vbs ' dim osh dim classpath classpath="./;./CopyTables.jar;./lib/*" set osh = createobject("wScript.shell") ' get the variables of the "process" environment set objEnv = osh.Environment("Process") objEnv("CLASSPATH") = classpath osh.run "java App -Dorg.apache.commons.logging.Log=log4j.properties >> console.log 2>>error.log",1 ==== Formatear fechas y números ==== Un ejemplo de tres formateadores: uno para fechas, otro para horas, y otro para números. Estos formateadores van a usar los formatos "a capón" en lugar de usar los que provee por defecto Locale, que debería ser la forma correcta de usarlos para que la aplicación fuese internacionalizable. import java.text.DecimalFormat; import java.text.DecimalFormatSymbols; import java.text.SimpleDateFormat; import java.util.Locale; SimpleDateFormat formatDate = new SimpleDateFormat("dd/MM/yyyy"); SimpleDateFormat formatDateFecharea = new SimpleDateFormat("yyyyMMdd"); SimpleDateFormat formatTime = new SimpleDateFormat("HH:mm"); DecimalFormat formatNumber = new DecimalFormat("#,###.##"); DecimalFormatSymbols symbols2 = new DecimalFormatSymbols(Locale.US); DecimalFormat formatNumberUS = new DecimalFormat("#,###.##", symbols2 ); ==== Parsing a Date in Java ==== try { // Some examples DateFormat formatter = new SimpleDateFormat("MM/dd/yy"); Date date = (Date)formatter.parse("01/29/02"); formatter = new SimpleDateFormat("dd-MMM-yy"); date = (Date)formatter.parse("29-Jan-02"); // Parse a date and time; see also // Parsing the Time Using a Custom Format formatter = new SimpleDateFormat("yyyy.MM.dd.HH.mm.ss"); date = (Date)formatter.parse("2002.01.29.08.36.33"); formatter = new SimpleDateFormat("E, dd MMM yyyy HH:mm:ss Z"); date = (Date)formatter.parse("Tue, 29 Jan 2002 22:14:02 -0500"); } catch (ParseException e) { } Example taken from http://exampledepot.com/egs/java.text/ParseDate.html. ===== Recursos Java ===== === Java básico === [[http://java.sun.com/docs/books/tutorial/index.html|The Java Tutorial]] [[http://java.sun.com/docs/books/tutorial/essential/environment/properties.html|Manejo de propiedades (properties) en java]] [[http://java.sun.com/j2se/1.4.2/docs/api/java/util/Properties.html|El formato de los ficheros de propiedades (properties) en java]] === J2EE === [[http://java.sun.com/javaee/|Java Enterprise Edition]] === API's de Java === Hay dos: una es la de la "Standard Edition", que contiene lo más básico: [[http://java.sun.com/javase/6/docs/api/]] Y la otra es la "Enterprise Edition" que contiene paquetes y clases para el desarrollo de aplicaciones web, servicios y programación con xml: [[http://java.sun.com/javaee/5/docs/api/]] === Java for Mobile Devices === [[http://www.netbeans.org/kb/trails/mobility.html|Mobile Applications Learning Trail]] [[http://developers.sun.com/mobility/learning/tutorial/|Tutorial de Java Mobile Edition]] === Online Training === [[http://java.sun.com/developer/onlineTraining/index.html|Sun's Online Training Web Site]] === Lista de charset, para cuando nos soliciten un parámetro "charset" === http://www.iana.org/assignments/character-sets ~~DISQUS~~