Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8134831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T10:11:19+00:00 2026-06-06T10:11:19+00:00

I am trying to call my Spring MVC controller from a JSP (I-Frame) and

  • 0

I am trying to call my Spring MVC controller from a JSP (I-Frame) and getting the following error on the browser

400 Bad Request,The request sent by the client was syntactically incorrect ()

here is my JQuery code to send request to the server

jQuery("#login").live('click', function(e) {
        e.preventDefault();
           jQuery.ajax({
            url: "https://localhost:9002/myApp/springSecurity/login.json",
            xhrFields: {
                   withCredentials: true
                },
            type: "POST",
            crossDomain:true,
            data: jQuery("#loginForm").serialize(),
           contentType: "json",

            success: function(data, status) {
                alert(data);
                alert(status);
                if (data.loggedIn) {
                   // location.href = getHost() + '${ctx}/users';
                    //login_pannel

                } else {
                    loginFailed(data);
                }
            },
            error: loginFailed
        });

    });

This is my controller code

@Controller
@RequestMapping("springSecurity/login.json")
public class SpringSecurityLoginController
{
@RequestMapping(method = RequestMethod.POST)
@ResponseBody
public SpringSecurityLoginStatus login(@RequestParam("j_username") final String username,
@RequestParam("j_password") final String password, final HttpServletRequest request, final HttpServletResponse response)
    {

    LOG.info("Starting login process");
    return springSecurityLoginService.login(username, password, request, response);
    }
}

While hitting the submit button i am getting no error on the server but while looking at browser console output it showing me the following error

"NetworkError: 400 Bad Request - https://localhost:9002/myApp/springSecurity/login.json"

This is Error information from Mozilla Response header

the request sent by the client was syntactically incorrect ().

I am not sure what causing this behavior.
Additionally i am using Spring security to handle authentication and authorization.

Edit

I debugged more and find out that the form values are not being submitted to my controller when i checked the value of j_username and j_password in my Controller tey are coming as null.

i even tried request.getParameter("param name"); but still same values are coming as null

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T10:11:21+00:00Added an answer on June 6, 2026 at 10:11 am

    In your jQuery, try changing “contentType” to “dataType” (more information here).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to make an asynchronous call from within my (Spring MVC based)
I am trying to make an ajax call using jquery in my spring MVC
I'm trying to do a jQuery AJAX call to my MVC controller in my
I'm trying to call a stored procedure from my MVC app using EntLib 5.0.
Trying to call a SAP SOAP Web Service from a generated sudzc app shows
I am trying to call the stored procedure using subsonic and getting Object Reference
I am trying to call cleartool from an java application, but cleartool hangs even
I'm trying to call a stored procedure from my .NET code which has one
I am trying to call a web service from asp.net 3.5 application. I have
I'm trying to call the MyJavascriptFunction(arg1) from an asp button and it's doesn't work...

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.