response redirect

background:

When the controller layer needs to be redirected to other HTML interface, you need to use the following code

// Set 302 status code 
response.setStatus (302 );
 // Set location response header 
response.setHeader ("location", "../adv.html" );
 // Note: once redirect, send to the server twice request

note:

@Controller: can jump to the interface

@RestController: Can't jump to html page, return string

Guess you like

Origin www.cnblogs.com/wangxue1314/p/12714887.html