I am in a specific page and I have a function on Javascript:
function goToAnotherpage(){
alert('goo');
$.ajax({
type : 'POST',
url : "/firstpage",
});
}
In Controller I enter inside the method firstpage
@RequestMapping(value="/firstpage", method = RequestMethod.POST)
public ModelAndView goToAnotherPage() throws ServiceException {
logger.debug("IT ENTER HERE);
return new ModelAndView("/secondpage");
}
I cannot enter in the second page. What is the problem?