The controller is designed to perform business operations or transactional logic. That is, in response to a user action, the application must perform one or more actions, and then decide which view to perform. This is why it is called the controller because it βcontrolsβ the application flow. When the controller completes its task, changes in the data should be visible to the user. However, preparing this data for display is not the task of the controller. Just make sure that the necessary actions are completed and that the data is available.
In this case, your jsp pages will display data and display them. As far as I understand, the preparation tool for viewing helps you take into account some aspects of the presentation, so preparation that can be done in several different views can be done by the preparer.
Thus, the example in the menu preparation docs is a good use case. Menus are sometimes dynamic, in the sense that it depends on the state of the system, which is accurately displayed to the user. Suppose you want to display a link to enter the menu when the user is not logged in and did not remove this link from the menu when the user is logged in. Instead of encoding this logic on every page that the menu should display, you can use ViewPreparer, which generates a menu that implements any necessary logic. This viewer can be linked to multiple pages.
Think of it more as manipulating data for viewing, rather than business logic.
source share