SSM中controller中redirect 返回的字符串

redirect/forward:url方式转到另一个Action进行连续的处理.
但是在实际的操作过程中,跳转成功了,但是跳转后显示的跳转连接的字符串!!!
搞得很郁闷,不知道问题出现在什么位置。为了实现效果使用了ModelAndView 方法。

今天问题解决了,问题是一开始就是用了@RestController注解,返回的都是json格式。

@RestController
@RequestMapping("/index")
public class IndexController

解决方法: 把@RestController换成@Controller

@Controller
@RequestMapping("/index")
public class IndexController 
	

猜你喜欢

转载自blog.csdn.net/weixin_40725027/article/details/84635930