Skip to main content

Posts

Showing posts with the label JavaEE

illegal character in Netbeans

If it is Maven project.  Add following into the POM file.  <properties>         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>   </properties> Or right click project, select  "Properties  \ Sources \ Encoding" and change to UTF-8 For Netbeans supports UTF-8 in default. You have add following netbeans_default_options = "-J-Dfile.encoding=UTF-8" at a  netbeans.conf  file in you  netbeans installation\etc\ Reference: http://stackoverflow.com/questions/5034891/how-do-you-set-the-encoding-to-utf-8-in-netbeans-6-9

Useful and influential Java libraries / frameworks

Web framework: Grails, Play, Tapestry, Primefaces, Vaadin Utility: Guava, Joda, Quartz, H2, Camel Backend: Spring, Spring Security, Hibernate, MyBatis, Jooq Unit testing: Mockito, PowerMock, Junit, TestNG, Spock You can check more at http://devrates.com/project/list?query=%5Bjava%5D Original Link: http://www.quora.com/What-are-top-10-most-useful-and-influential-Java-libraries-frameworks

How to make singleton thread-safe

refer link:  http://www.javagyan.com/useful-tips/howtocreatethread-safesingleton A singleton class should be designed to ensures that there exists only one instance per application. Special care must be taken if your application is deployed on a clustered environment as in this case it is possible that multiple instance of your singleton class are available in your application.    Here are a few ways to create a thread safe singleton classes in your application.  1) Lazy loading Singleton instance - Using Synchronized method or block public class SingletonClass{     private SingletonClass sc;     private SingletonClass(){}     public static SingletonClass getInstance(){         synchronized(SingletonClass.class) {               if (sc == null) {            ...