I am calling a view of one controller from another controller(say controller1 and controller2 respectively). And it is successfully working, but the browser shows the url of the controller1 even though I redirected to controller2. How to change this?
@Controller
@SessionAttributes
public class UserFormController {
@Autowired
private UserService userService;
@Autowired
private Controller2 controller2;
@RequestMapping(value = "/method1", method = RequestMethod.GET)
public ModelAndView redirectFormPage() {
return controller2.redirectMethod();
}
here, url "method1" is showing. I want to shows the called url.