Maybe I should just keep my mouth shut and move forward, but something tells me things aren't working as nicely as I think they are and I need to fix it.
Basically, I'm doing a simple AJAX call to tell the server what the user has selected: an already existing project or a new project. The AJAX looks like this:
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's blowing my mind is, I am getting the call into manageProjects with the correct variables and values I expect. The server handles the request and returns a pojo I created called StatusResponse wrapping a boolean (success or failure) and a list of server feedback messages. I create one with the simple status of "true" for success and pass it back.
The client then throws up a 404 manageProjects.html not found and continues on its merry way as though nothing has gone wrong.
So....did it find it or not? If a StatusResponse-type pojo is an inappropriate response from a Spring MVC controller, what IS the right response? Why would the message successfully hit the controller but then the client receive a 404?!
Thanks for any insight....
Footnote: apologies if this looks similar to an earlier question from today. I came at the core problem from the wrong angle and created more confusion than necessary in that posting...