In a Spring web application, sometimes, we just read the data from the server side like in our example. Reading data for all the accounts was a simple read call, and no request parameter was required. But in case you want to fetch data for a particular account, then you have to pass the account ID with the request parameters. Similarly, for creating a new Account in the bank, you have to pass an account object as a parameter. In Spring MVC, we can accept the request parameters in the following ways:
- Taking query parameters
- Taking request parameters via path variables
- Taking form parameters
Let's look at each of these ways one by one.