In my project deployed on tomcat there are two Wars. I have to redirect the request from one war to another war on a UI action. It is currently based on Spring MVC architecture. So I have added this piece of code in the first war to redirect the requests to my other war, but was unable to redirect it.
@Controller
@RequestMapping(value = "/monetize")
public class MyFirstWarController {
private static final Logger logger = LoggerFactory.getLogger(MyFirstWarController.class);
@Autowired
private ServletContext servletContext;
@RequestMapping(value = "/dashboard", method = RequestMethod.GET)
public String showConsumerInterests(HttpServletRequest request, Model model) {
//WebApplicationContextUtils.getRequiredWebApplicationContext(request.getSession().getServletContext());
logger.info("In the First War Servlet Context");
servletContext = servletContext.getContext("/monetize");
return "monetize/dashboard";
}
}
I am trying to reach Controller of my Second War, where I have provided the MVC controller for the request http://MyLocalHost:8080/monetize/dashboard
, with a similar Controller like the above.
Is there any thing I need to provide in the ViewResolver. I couldn't find any solution to this on the net.