Spring MVC Controller: Redirect without parameters being added to my url

后端 未结 6 427
伪装坚强ぢ
伪装坚强ぢ 2020-11-30 04:58

I\'m trying to redirect without parameters being added to my URL.

@Controller
...
public class SomeController
{
  ..         


        
6条回答
  •  甜味超标
    2020-11-30 05:18

    If you're using Spring 3.1, you can use Flash Scope, otherwise you can take a look at the method used in the most voted (not accepted) answer here:

    Spring MVC Controller redirect using URL parameters instead of in response

    EDIT:

    Nice article for 3.1 users:

    http://www.tikalk.com/java/redirectattributes-new-feature-spring-mvc-31

    Workaround for non-3.1 users:

    Spring MVC custom scope bean

提交回复
热议问题