Posts

Showing posts from 2013

Places to visit in Singapore

Places to visit in Singapore Night Safari Zoo Universal Studio Santosa Island Activities to do  Segway Tour Marina Bay Flyer

Spring : Encrypt Spring Datasource Password Credentials

Encrypt Spring Datasource Password Credentials (1)  EncryptedDataSource.java I have written a wrapper class EncryptedDataSource for org.springframework.jdbc. datasource. DriverManagerDataSource and overridden getPassword() method. EncryptedDataSource class is injected in spring datasource configuration xml file. Which calls the overriden getPassword() method of data-source at the time of database connection. getPassword() method decode the encrypted password into actual password. To decrypt or encrypt password we used "BASE64Decoder" algorithm.   import  java.io.IOException;   import  org.springframework.jdbc. datasource. DriverManagerDataSource;   import  sun.misc.BASE64Decoder;   import  sun.misc.BASE64Encoder;   public   class  EncryptedDataSource  extends  DriverManagerDataSource{                     @Override            public  String getPassword() {                   String password =  super .getPassword();                    return  decode(password);           }    

Spring : Reading Properties file

Spring 2.5 : Reading Properties file: PropertyPlaceholderConfigurer : The PropertyPlaceholderConfigurer is used to externalize property values from a BeanFactory definition, into another separate file in the standard Java Properties format. This is useful to allow the person deploying an application to customize environment-specific properties (for example database URLs, usernames and passwords), without the complexity or risk of modifying the main XML definition file or files for the container.   <bean   class = "org.springframework. beans.factory.config. PropertyPlaceholderConfigurer" >        <property   name = "location" >                <value>database.properties</ value>        </property> </bean>   Getting Property Value in Spring Configuration: Use ${propertyKey}   <bean id="dataSource"  class="org.springframework. jdbc.datasource. DriverManagerDataSource">                    <property

Struts2 Spring Integration and Accessing ApplicationContext

Struts2 Spring Integration   To enable Spring integration, simply include struts2-spring-plugin-x-x-x. jar in your application.   If you are using more than one object factory, (for example, by including both the Spring and Plexus plugins in your application,) you will need to set the struts.objectFactory property in  struts.properties  or in one of several XML files via  Constant Configuration : struts.properties struts.objectFactory = spring struts.xml <struts>  <constant name="struts.objectFactory" value="spring" />  ... </struts> Configure the Spring listener  - web.xml <listener>    <listener-class>org. springframework.web.context. ContextLoaderListener</ listener-class> </listener> More applicationContext configuration files needed? Since the Spring integration uses a standard Listener, it can be configured to support configuration files other than applicationContext.xml. Adding the following to your web

Places To Visit in Malvan

Places To Visit in Malvan Sindhudurga fort:- Sindhudurg is a fort which occupies an islet in the Arabian Sea, just off the coast of Maharashtra in western India. The fortress lies on the shore of the Malvan town of Sindhudurg District in the Konkan region of Maharashtra. Tsunami Island,  Tarkarli Beach Devbaug Beach Seagull point  Activity To Do in Malvan Snorkeling,  Scuba Diving, Dolphin Safari Water Sports like the Bumper ride, Banana ride, Dolphin ride, Jet scooter.

Places To Visit in Manali

Image
Places To Visit in Manali Manikaran Gurudwara Rohtang Pass Solang Valley (Snow Point) -13 km from Manali.  Paragliding ATV bike riding Anjani Mahadev  is situated around 2 km from the Solang ski slopes. It is a must-visit place. You can go by walk or horse, both ways it is nice. Local Manali Hadimba Devi Mandir   - You can click your pic with Yak outside temple. Tibetan monasteries Club house Manu temple

Love Shayari

Image
  अच्छा लगता हैं तेरा नाम मेरे नाम के साथ, जैसे कोई ख़ूबसूरत सुबह जुड़ी हो किसी हसीं शाम के साथ Mujhe mohabbat do tarikon se hoti hai..  ek tumhara hokar aur dusra tumhen apna bana kar. Jab samne hote ho tum .. Na jane kyo hosh kho baith the hai hum.. Milti hai nazar jab jab tumse… Sab kuc bhul jate hai hum.. Hoti hai tu itne kareeb.. Phir bhi dil ki baat kehne se ruk jate hum.. Logon Ne Kaha Ki Main Sharabi Hoon, Maine Kaha Unho Ne Ankhon Se Pilaiee Hai. Logon Ne Kaha Ki Main Ashiq Hoon, Maine Kaha Ashiqi Unho Ne Sikhaiee Hai. Logon Ne Kaha Ki Main Dewana Hoon, Maine Kaha Unki Mohabbat Rang Laiee Hai.