Spring is actually really deep. It has lots of functionality in it. I can speak to Spring MVC for you, which is a subset of Spring. Spring MVC standardizes the code you write on your server side web application. It gives you tools as well as prescribes a solution in which you write your code in. The best way to understand how Spring MVC works is to walk through a transactions lifecycle.
1) You post form parameters to a spring MVC application from the browser to a URL that Spring is configured to listen for. Typically on the browser you either have a classic HTML form or a more advanced browser side framework like WebRocketX or
Angular.
2) Spring has this URL mapped to a method in its controller object using annotations. The parameters from the request are mapped to land in a
java object that is an input parameter to this method. This java object has setters that match the parameter names and the framework takes care
of matching all this data up for you.
3) At this point in the controller method your code is running plain old java. You can take the data sent by the parameters and do whatever you want with it, like send it to a database, perform a query etc. Often there is another api layer called a service layer at this point. That sits between your controller method and the database.
4) Mostly likely inside this controller method you will retrieve information that you will send back to the user. That info will come in the form of a javaobject populated with data. The controller method puts this data into a model attribute, which is a annotated java object and then hands over control to a
jsp.
5) The JSP has HTML in it and certain points where dynamic data will be written into it. The best way to render data into this places is using JSTL. You can use JSP scriptlets but they are messy and therefore out of fashion. The JSTL tags read the information from the model attribute that came from the controller.
6) This JSP renders HTML text which is sent back to the browser. The browser renders it directly as a full page or includes it in just parts of the page.
7) The user enters input presses a button and the fun starts all over again.
