I am working on updating our legacy code with uses jsp and servelts to angular 7. However, there are some parts of the legacy code that i still have to maintain. So i have to make some calls to webservices that have below webservice.
@RequestMapping(value = "/mainpage", method = { RequestMethod.GET, RequestMethod.POST })
public ModelAndView portalMainPage(HttpServletRequest request, HttpServletResponse response) throws Exception {
/* Code here to do a few things */
return new ModelAndView(".company.portal.mainpage");
}
I try to call this from angular but as you can see it returns a model and view and has its own jsp page for rendering.
How do i call this from angular and have it render the jsp page?
I tried to call it but i get a HTTP 302 error message and it redirects to index.html page which the the welcome page for angular. It is not able to render jsp pages.
The way i call this is directly from the browser: https://company/portal/mainpage.do. After i do this i checked network settings in developer tools. It shows 302 message and then reidrects it to index.html.