0

I have to past xml file in header. I was able to do it using ajax GET but if xml is large then get is not working. So I would like to implement this using Ajax POST. I tried many ways many many ways but failing. Please help me on how to implement Ajax POST or Do we have any other options to post large XML.

Here is Ajax POST:

$.ajax({
    type: "POST", 
    url: "hello",
    success: function(resp){
        alert(resp)
    },
    error : function(e) {
        $(document.body).css({"pointer-events": "", "cursor": "default"});
        alert("Error" + e.responseText);
    }
});

Controller:

@Controller
@RequestMapping("/hello")
public class TestController{
@RequestMapping(method = RequestMethod.POST)
 @ResponseBody
  public String printHello(ModelMap model) {
   System.out.println("Success");
  return "success";
   }
}

Error:

Nov 16, 2016 11:56:35 PM org.springframework.web.servlet.PageNotFound noHandlerFound
WARNING: No mapping found for HTTP request with URI [/ESBMonitorAppAjax/403] in DispatcherServlet with name 'mvc-dispatcher'
Hari
  • 1
  • 2

0 Answers0