Register Spring Beans to BeanFactory using registerSingleton

spring

Spring’s strength lies on its core framework’s Inversion Of Control (IOC) and how the beans are instantiated and managed by the IOC container. All the beans in the spring’s IOC containers are managed as the singleton beans by default for the efficient and good performance. As a good practice, you should never create instance for […]

How to use Spring EL in XML configurations?

spring

In our previous tutorial we have explained in detail about how to use the spring expression language. This tutorial is a simple example to demonstrate how to use the expression language in XML configuration file. Employee.java Company.java SpringExpressionDemo.java beans.xml If you run the above example program, you will get the output as: I hope this […]

Use @Import for Importing JavaConfig Files in Spring Projects

spring

In my previous article I have explained about the JavaConfig in Spring 3.0. It is a new way of configuring the bean definitions without using the traditional XML files. Also I have listed the annotations defined as part of JavaConfig approach. In the list, @Import is the one such annotation used for consolidating all the […]

JavaConfig in Spring 3.0

spring

Spring 3.0 has introduced new way for configuring the spring beans. In fact this was maintained by spring framework separately as JavaConfig. Later it is merged to the spring core framework and all the features are directly accessible from the spring core. Instead of using the XML files, we can use plain Java classes to […]

How to Protect PDF with Password using iText in Java?

PDF Thumbnail

In my previous article I have explained about how to create PDF document using iText with simple example. This tutorial explains how to add a password protection for your PDF document. iText doesn’t provide the password feature in its own API, however it internally uses another third part implementation and implements the password protection. iText internally […]

How to Create PDF using iText in Java?

PDF Thumbnail

Generating PDF report is the very general requirement in most of the Java projects. iText is the most popular PDF API used by the Java developers for generating the PDF report. It is very simple and easy to get started writing simple PDF files. If you are familiar with iText API,  it provides more advanced […]

How To Convert Properties File Into XML File Using Java?

xml

In my previous tutorials I have explained about how to use DOM Parser and SAX Parser. This tutorial explain with very simple utility method available in the Java package used for converting your existing properties file to a XML file. Sometimes this may be the requirement for Java developers, instead of manually converting properties file […]

How to Parse XML file using SAX Parser?

xml

In my previous article I had written the example program for parsing a simple XML file using the DOM parser. As I have mentioned in the earlier posts, DOM and SAX are the two popular parser used for reading and manipulating the XML files. If you use any of the XML utility like JAXB for […]

How to Parse XML file using DOM Parser?

xml

In this tutorial I will write a simple example program for parsing a XML file using the DOM parser. DOM parser reads the entire XML file and loads into the memory. It forms a tree structure in the memory and returns the element details when queried. It is the faster when comparing to the SAX […]

Difference Between @Resource, @Autowired and @Inject in Spring Injection

spring

It is very common confusion among the spring developers that what is the real difference between these three (@Resource, @Autowired and @Inject) annotations used for injecting the objects. I have come across this question from our readers so dedicated this post for explaining the main difference between these three annotations. Infact, these three work very […]

Close
Please support the site
By clicking any of these buttons you help our site to get better