3

I am trying to submit a login form with the post request but I am not getting all the request parameters (like username, and password) in the controller.

JavaScript code:

loadurl = doamainName + "/ajax-call-handler";
$.ajax({
    url: loadurl,
    method: "POST",
    data: dataField
}).done(function (data) {
}

Controller code:

@RequestMapping(method = RequestMethod.POST, value = "/{languageName}/{pageName}")
    public String handleGetPage(@PathVariable Map<String, String> pathVariables, HttpServletRequest request, HttpServletResponse response) {
        String ajaxPageName = request.getParameter("ajaxPageName");
        if (ajaxPageName == null || ajaxPageName.length() == 0) ajaxPageName = "None";
}
3
  • Wow, sort your code formatting out! Is this Java Dxa? Commented Nov 29, 2015 at 20:05
  • Yes. Based on DXA Java 1.0 Commented Nov 30, 2015 at 11:02
  • 1
    Seems like a general Spring MVC question to me... Anyways, I don't see any evidence in your code samples that request parameters are sent by the client, nor that any are expected by the server (?) Commented Nov 30, 2015 at 18:39

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.