Free Data Structures and Algorithms Course









Subscribe below and get all best seller courses for free !!!










OR



Subscribe to all free courses

What are various Namespaces in the Spring Configuration File ?.

What are various Namespaces in the Spring Configuration File ?.

1. aop Namespace


1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xsi:schemaLocation="
http://www.springframework.org/schema/beans 
 http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop 
 http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">

<!-- <bean/> definitions here -->

</beans>

aop Namespace Description - 

aop namespace provides developer a namespace which has elements used for declaring aspects. Generally, this namespace makes @AspectJ-annotated classes as Spring aspects which acts as proxies.


2. util Namespace


1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:util="http://www.springframework.org/schema/util"
       xsi:schemaLocation="
http://www.springframework.org/schema/beans 
 http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/util 
 http://www.springframework.org/schema/util/spring-util-2.0.xsd">

<!-- <bean/> definitions here -->

</beans>

util Namespace Description -

As the name suggest this namespace provides developer utility elements. This namespace provides ability to use collections with Spring Framework. 


3. beans Namespace


1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="
http://www.springframework.org/schema/beans 
 http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">

    

</beans>

beans Namespace Description -

It is mostly used for declaration of beans and how they are related to each other. Its the core spring namespace which is important for configuring beans.


4. jee Namespace


1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:jee="http://www.springframework.org/schema/jee"
       xsi:schemaLocation="
http://www.springframework.org/schema/beans 
 http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/jee 
 http://www.springframework.org/schema/jee/spring-jee-2.0.xsd">

<!-- <bean/> definitions here -->

</beans>

jee Namespace Description -

This namespace is used when we integrate spring with JNDI and EJB. This namespace provides elements for using it well with Java EE.


5. jms Namespace


1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:jms="http://www.springframework.org/schema/jms"
       xsi:schemaLocation="
http://www.springframework.org/schema/beans 
 http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/jms 
 http://www.springframework.org/schema/jms/spring-jms-2.5.xsd">

<!-- <bean/> definitions here -->

</beans>

jms Namespace Description -

Usually used to configure Message Driven Beans i.e. MDB's with the Spring container.


6. context Namespace


1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.

<beans  xmlns="http://www.springframework.org/schema/beans"
  xmlns:context="http://www.springframework.org/schema/context"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="
   http://www.springframework.org/schema/beans
   http://www.springframework.org/schema/beans/spring-beans.xsd
   http://www.springframework.org/schema/context
   http://www.springframework.org/schema/context/spring-context-2.5.xsd">

</beans>



context Namespace Description - 

context namespace is very much important namespace of all, it is used by spring container to auto-detect and auto-wire beans. This namespace provides elements which helps in injecting of objects and thus providing ability to have Dependency Injection.



7. lang Namespace


1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:lang="http://www.springframework.org/schema/lang"
       xsi:schemaLocation="
http://www.springframework.org/schema/beans 
 http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/lang 
 http://www.springframework.org/schema/lang/spring-lang-3.0.xsd">

<!-- <bean/> definitions here -->

</beans>

lang Namespace Description - 

lang namespace provides us with the elements which helps us to configure beans implemented in different languages such as JRuby, Groovy etc.

8. mvc Namespace


1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:mvc="http://www.springframework.org/schema/mvc"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="
        http://www.springframework.org/schema/beans 
         http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
        http://www.springframework.org/schema/mvc 
         http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd">

    <mvc:annotation-driven />

<beans>

mvc Namespace Description - 

mvc namespace enables capabilities of MVC architecture such as Model - View - Controller framework. It enables usage of controllers, interceptors and view components.

9. oxm Namespace


1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:oxm="http://www.springframework.org/schema/oxm"
    xsi:schemaLocation="http://www.springframework.org/schema/beans 
 http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
    http://www.springframework.org/schema/oxm 
http://www.springframework.org/schema/oxm/spring-oxm-1.5.xsd">


</beans>

oxm Namespace Description -

Very important namespace which provides JAXB sort of support of mapping Spring objects to XML mappings. That is converting of Spring objects to XML formats.

10. tx Namespace


1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:aop="http://www.springframework.org/schema/aop"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xsi:schemaLocation="
http://www.springframework.org/schema/beans  
 http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/tx 
 http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
http://www.springframework.org/schema/aop  
 http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">

<!-- <bean/> definitions here -->

</beans>

tx Namespace Description - 

tx namespace enables support for transaction management in Spring framework.
 
© 2021 Learn Java by Examples Template by Hubberspot