• 31 July

    Spring Restful client – RestTemplate example

    In this tutorial, we will see how to create rest client using Spring RestTemplate. We have already seen Spring restful web services crud example. We have used postman utility to demonstrate all HTTP methods such as get, post, delete and put but if you want to write java code for restful client , you can […]

  • 27 July

    Prefix “context” for element “context:component-scan” or “context:annotation-config” is not bound : Spring error

    When you are working on spring or spring mvc application, you may encounter below error message. org.xml.sax.SAXParseException: The prefix “context” for element “context:component-scan” is not bound . or org.xml.sax.SAXParseException: The prefix “context” for element “context:annotation-config” is not bound . This issue generally occurs when you do not include context namespace. For example: Lets say you have below […]

  • 26 July

    How to load multiple Spring configuration files

    In this post , we will see how to load multiple spring bean configuration files. Sometimes, you have multiple spring bean configuration file , you may have different configuration file for service, different for business object. When you are working on complex application, it is not good practice to have only single xml configuration, you […]

  • 25 July

    Spring MVC interceptor HandleInterceptorAdapter example

    Sometimes you need to intercept incoming request and do some preprocessing or you need to do it after completion of request. It is very much similar to filters that we use with servlet. There are two ways to use interceptor with Spring MVC. Spring MVC tutorial: Spring MVC hello world example Spring MVC Hibernate MySQL […]

  • 22 July

    Spring AOP AspectJ Annotation Example

    In this post, we will see Spring AOP AspectJ Annotation examples. If you are not familiar with Spring AOP terminology, you may go through Spring Aspect oriented programming(AOP) tutorial. Following are the AspectJ annotations which we are going to use to implement Spring AOP. @Aspect : To declare a class as Aspect. Annotations which are […]

  • Spring Interview questions
    16 July

    Spring interview questions and answers for experienced

    In this post, we will see Spring interview interview questions. If you are java/j2ee developer and have some experienced on Spring, you are going to face Spring interview questions. If you are looking for below queries then this post will help you as well. Spring interview questions for 3 years experience Spring interview questions for […]

  • 16 July

    Spring AOP tutorial

    This is 16 of 16 parts of tutorial series Tutorial Content: Spring tutorial for beginners Introduction to spring framework Spring interview questions Dependency injection(ioc) in spring Spring hello world example in eclipse Spring java based configuaration Dependency injection via setter method in spring Dependency injection via constructor in spring Spring Bean scopes with examples Initializing […]

  • 09 June

    Spring autowiring by constructor

    Spring autowiring by constructor is similar to autowiring by type but it is applied to constructor argument. If more than one bean property matches, then it throws fatal exception. Below digram will make it clear: For example: I am taking example of autowire by “constructor” here.It will be almost same as Dependency injection via setter method with […]

  • 04 May

    Spring autowiring byType

    Spring autowiring byType means autowiring on the basis of datatype. if any bean property datatype matches with exact one other bean’s datatype declaration then spring will automatically takes care of dependency. If more than one bean property matches, then it throws fatal exception. Below diagram will make it clear: For example: I am taking example […]