jquery - $.getJSON problem in spring mvc3.0 -
I have the following javascript functions that I call upon the submit button click ....
Function CheckUser () {var uname = $ ('# username'). Val (); Var pword = $ ('#password'). Val (); Warning (uname); Warning (pword);
$ .getJSON ("login.html", {username: uname, password: password}, function (message) {alert (message);}); } I am using Spring MVC 3.0 ... the following are the controllers 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; Public class LoginController {@RequestMapping ("/ login.html") Public @ResponseBody String getLoginStatus (@RequestParam ("username") string @Controller username, @resposem ("password") string password) {System.out.println ("\ n \ n Login Controller \ n \ n"); If (user name == "supervibad" & amp; password == "superfluous 123") {return "login succeeded !!!"; } Other {return "login failed"; }}}
When I click the submit button, a function corresponding to the /login.html action does not apply .... I used DispatcherServlet to map the following requests I am ...
Here is the spring-servlet.xml
http://www.springframework.org/schema/beans/spring-beans.xsd ">
<
Project Spring org.springframework.web.servlet.DispatcherServlet 1
Spring * .html
index.jsp
Can anyone tell me the problem, please
Your function
It might have something to do with your presenting ceremony, you did not show it. Ran on my page. Check User
Good
Comments
Post a Comment