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 976417
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T03:44:35+00:00 2026-05-16T03:44:35+00:00

I have the following javascript function which i call on the submit button click….

  • 0

I have the following javascript function which i call on the submit button click….

function checkUser()
{
var uname=$(‘#username’).val();
var pword=$(‘#password’).val();
alert(uname);
alert(pword);

      $.getJSON("login.html",{username: uname, password: pword},
              function(message){
   alert(message);
          });
  }

i am using spring mvc 3.0….. Following is the controller that i use…

package com.web.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class LoginController
{
@RequestMapping(“/login.html”)
public @ResponseBody String getLoginStatus(@RequestParam(“username”) String username, @RequestParam(“password”) String password)
{
System.out.println(“\n\nin login controller\n\n”);
if(username==”apoorvabade” & password==”apoorva123″)
{
return “Login successful!!!”;
}
else
{
return “Login failed”;
}
}
}

when i click on the submit button, the function corresponding to the /login.html action is not invoked…. i am using the DispatcherServlet to map the requests to the following….

here is the spring-servlet.xml

http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd“>

/WEB-INF/jsp/

.jsp

web.xml:

Spring Ajax Tutorial Project

spring

org.springframework.web.servlet.DispatcherServlet

1

spring
*.html

index.jsp

Can anybody tell me the problem please?

  • 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-05-16T03:44:36+00:00Added an answer on May 16, 2026 at 3:44 am

    It probably has to do with your submit function. You didn’t show that. I ran your function on my page. checkUser is good to go.

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

Sidebar

Related Questions

I have the following javascript: $('#ge-display').click(function (event) { window.open('/googleearth/ge-display.php','','scrollbars=yes,menubar=no,height=650,width=1000,resizable=yes,toolbar=yes,location=no,status=no'); event.stopPropagation(); return false; }); the
I have the following JavaScript in my site : $(function() { var $cells =
I have the following: Javascript: $(.bg .thumb_wrapper).click(function() { $(.bg .thumb_wrapper).removeClass(active); $(this).addClass(active); }); So every
I have the following function which pulls in a Javascript block via AJAX from
I have a JavaScript function which i call in the onchange handler of a
I have the following JavaScript (I'm using jQuery): function language(language) { var text =
I have following pages: popup.html <script type=text/javascript> //requires function doFunction(){ alert(hi); } </script> <button
Following is the Javascript function which is using AJAX call in my Spring MVC
I have the following javascript function: <script type=text/javascript> function quickCardRegister_OnCompleteSave() { publishContent('This is a
I have the following javascript method: function 123_test_function(){ } The function is generated by

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.