In this tutorial, we illustrate how to create a dynamic factory bean in Spring. Suppose we have a file converter application which converts files based on a specific conversion type...
By default, the @Autowired annotation of the Spring framework works by type, it automatically instantiates an instance of the annotated type. In a typical enterprise application, it is very common...
In this tutorial, we discuss 2 ways for retrieving the context path in a Spring Web application. 1- HttpServletRequest The typical way of getting the context path is through the...
In this tutorial, we discuss several ways of reading a resource file from classpath in a Spring MVC application. 1- ClassPathResource Using ClassPathResource class provided by Spring Core, you can...
In this tutorial, we discuss how to upload files with Spring MVC. If you’re more interested in doing it the old way using Servlets, then check “How to upload files...
In this tutorial, we discuss several ways of passing data from a JSP view to a Spring controller. 1- Pass form fields The most common scenario for sharing data between...
This tutorial describes how to pass data from a Spring controller to a JSP view. If you’re still using servlets, then check our “Pass data from servlet to JSP” tutorial....