Perhaps I should just close my mouth and move forward, but something tells me that everything is not working as well as I think, and I need to fix it.
Basically, I make a simple AJAX call to tell the server what the user has chosen: an existing project or a new project. AJAX is as follows:
var dataString = 'existingProject='+ $("#existingProject").val() + '&newProjName=' + $("#newProjName").val(); //AJAX call to post selections to server $.post('/myproj/manageProjects.html',dataString);
The Spring MVC signature that handles this post call looks like this:
@RequestMapping(value="/manageProjects",produces="application/json",method=RequestMethod.POST) public StatusResponse manageProjects( @RequestParam(value="existingProject",required=false) String existingProj, @RequestParam(value="newProjName",required=false) String newProj, HttpSession session){
What blows my mind, I get a call in manageProjects with the correct variables and values ββthat I expect. The server processes the request and returns the pojo I created, called StatusResponse, which wraps a boolean (success or failure) and a list of server feedback messages. I create one with a simple βtrueβ status for success and pass it back.
The client then issues 404 manageProjects.html, which was not found and continues its fun journey as if nothing had happened.
So ... found it or not? If a pojo like StatusResponse is an inappropriate response from Spring MVC, what is the correct answer? Why did the message successfully get to the controller, but then the client received 404 ?!
Thanks for any insight ....
Footnote: Apologies if this sounds like an earlier question from today. I came to the main problem due to the wrong angle and created more confusion than necessary in this post ...