当前位置:网站首页>6.9.1 flashmapmanager initialization (flashmapmanager redirection Management) - SSM in depth analysis and project practice

6.9.1 flashmapmanager initialization (flashmapmanager redirection Management) - SSM in depth analysis and project practice

2020-11-06 01:14:46 Memory

6.9 FlashMapManager Redirection Management

FlashMapManager It's for retrieval and preservation FlashMap Instance policy interface .

Spring3.1 And then we introduced a new one called Flash Attribute The function of , It is mainly to solve the problem of submitting data repeatedly in the form , application POST/Redirect/GET(PRG) Mode to prevent duplicate submission of data ( Form passed HTTP POST After the request is submitted , The user refreshes the response page before the server returns , Will cause the original form content to be submitted repeatedly , It may lead to some unpredictable results ).

So use the redirection request to the success page , In this way, users will not submit the form when they refresh , It's loading new GET request . But redirection introduces the problem of not passing request parameters and properties , therefore Spring Of Flash Attribute It's to ask for redirection before , Solve the problem of temporary storage .

FlashMap Provide a method for one request to store data properties used in another request .

When from a URL Redirect to another URL when ,FlashMap The request data will be saved before redirection ( It is usually kept in Session in ), And write the data to the request when redirecting , And immediately after the reset, the original will be saved in Session Request data deletion in . and FlashMapManager It's used to manage FlashM

版权声明
本文为[Memory]所创,转载请带上原文链接,感谢