Archives for Java

Spring: access to properties or parameters in all places of the application
Hi, I propose you a simple solution based on Spring context, PropertyPlaceholderConfigurer to load and access to properties or parameters in all places of an application. First, we have a properties' file (for example) named "" in the server's classpath (for example in the "etc" folder of TOMCAT server) containing: Secondly, create a class containing a attribute for each parameter of above ...more»
Spring: Transaction management with checked, unchecked exceptions
Often, developers forgotten the transactional behaviour of proxies Spring: - by default, the transaction is rollbacked only in the case of runtime, unchecked exceptions (an instance or subclass of RuntimeException) and for Errors; - the transaction is not rollbacked if a checked exception is thrown from a transactional method. A good practice is to create 2 types of checked exceptions extending Exception: - ...more»
Java: Fake SMTP Server for your development
Hello, Today, I propose a very simple fake SMTP server designed for unit and system testing applications that send email messages. The class is a ServerSocket (Runnable) which responds to the standard SMTP commands but does not deliver messages to the user. The messages are printed in the full SMTP server log containing all the information exchanged between the SMTP server ...more»
Apache: Commons Compress – zip, tar, gzip
For the needs of a project, I have had the opportunity to use the Apache Commons Compress libary in order to archive and compress files in ZIP, TAR, GZIP. Here, a brief presentation of this library from Apache: Apache Commons Compress software defines an API for working with compression and archive formats. These include: bzip2, gzip, pack200 and ar, cpio, jar, ...more»
Page 30 of 30:« First« 27 28 29 30
Copyright ® 2012 Huseyin Ozveren. No reproduction, even partial, can be used from this site and all its contents including text, documents, images, etc.. without the express permission of the author.