Posts

JDK7 Highlights & Hashing Techniques

Image
Seven New Features in Java(JDK 7) Programming Language 1.     Binary Literals In Java SE 7, the integral types ( byte ,   short ,   int , and   long ) can also be expressed using the binary number system. To specify a binary literal, add the prefix   0b   or   0B   to the number. The following examples show binary literals:  int a=010; // will give 10   (upto JDK6)  int b=  ob 010 ;  will give 2. ( in JDK7 it will consider as binary literal) 2.     try with resource statement try ( Autoclosable Implementation class ) {}   Any object which implements AutoCloseable/ Cloneabl interface can be passed to try(){} block. but this no where related to try catch Exception handling one. this is useful for IO Streams ,JDBC where we need to close the connections after using it. try() will take care of closing operations.  class MyCustomClosable implemen...

Spring Security and Hibernate Integration

Introduction Table of Contents Introduction Configurations Introduction Spring security is the one of the best security framework for Java based web application. This tutorial demonstrates integration of spring security framework using Hibernate Annotations. Code snippets provided in this tutorial will helps you to quickly add to your application. This Tutorial doesn’t cover basics of spring & spring security in details.you can get those details from official sites. Configurations Spring-security.xml looks like below. Create appropriate pages. Role and URL access configured as shown below spring-security.xml <http auto-config = " true " access-denied-page = " /accessdenied.jsp " > <intercept-url pattern = " /tester/* " access = " ROLE_TESTER " /> <intercept-url pattern = " /admin/* " access = " ROLE_...